Intro to Capstone I: Regression

Overview

You've spent the last four modules building a regression toolkit: data preparation (module 07–08), classification concepts that transfer directly to regression (module 09), and in module 11 you learned linear regression, polynomial regression, regularization, and the full evaluation framework. This capstone puts all of it together — on a dataset you choose, for a question you define.

Unlike the case studies in modules 08 and 10, which walked you through a specific dataset with detailed instructions, this capstone is student-directed. You'll select a dataset, frame the regression problem, perform EDA, clean and engineer features, train and compare models, and present your findings — just as a practicing data scientist would.

Learning Objectives

By the end of this capstone, you will have demonstrated the ability to:

  • Independently frame and execute a regression project from raw data to evaluated model.
  • Apply EDA, cleaning, feature engineering, and model evaluation in an integrated workflow.
  • Communicate findings clearly with code, visualizations, and written interpretation.

What This Capstone Is

The capstone is a single Jupyter notebook hosted on GitHub. It is not a set of exercises with predetermined answers — it is an original analysis that you design and carry out. The notebook must tell a coherent story: why this dataset, what you found, what you built, and what it means.

The capstone covers three phases:

PhaseLessonWhat you produce
Planning & ExplorationProject Planning & Dataset ExplorationProblem statement, EDA with visualizations, cleaned dataset
Modeling & EvaluationModeling & EvaluationThree trained models, comparison table, residual analysis, tuned final model
Submission—GitHub link, 3-paragraph written summary

Deliverables

1. Jupyter Notebook on GitHub

Your notebook must include:

  • Problem statement — one paragraph explaining what you're predicting, why it matters, and what dataset you're using
  • Dataset description — source, size, features, and target variable
  • EDA — at least five visualizations with written interpretation of each
  • Data cleaning — documented decisions (what you changed and why)
  • Feature engineering — at least two engineered or transformed features with justification
  • Three models — trained and evaluated with the same metrics
  • Model comparison — a table showing MAE, RMSE, and R² for all models
  • Hyperparameter tuning — at least one model tuned with cross-validation
  • Residual analysis — residual vs. predicted plot and histogram for your best model
  • Conclusion — written summary of findings and honest assessment of limitations

2. Written Summary (3 paragraphs)

Submitted alongside the notebook link. Write as if explaining to a technically literate colleague who has not seen your notebook:

  • Paragraph 1: What dataset did you choose and what question are you answering?
  • Paragraph 2: What did EDA reveal about the data, and what cleaning decisions did that drive?
  • Paragraph 3: Which model performed best and why? What does the error mean in practical terms?

Choosing a Dataset

Requirements

Your dataset must:

  • Have a continuous numeric target variable (not a category or count that can't take fractional values)
  • Have at least 500 rows and 5 features (more is better)
  • Require at least some cleaning — datasets with no issues provide no opportunity to demonstrate those skills
  • Be publicly available and citable

Avoid: The California Housing dataset (used throughout module 11) and the Titanic dataset (used in earlier modules).

Suggested Datasets

The following datasets work well for a regression capstone. All are freely available.

DatasetTarget variableSourceDifficulty
Ames HousingHouse sale priceKaggle (house-prices-advanced-regression-techniques)Medium-High (80 features, requires thoughtful encoding)
Medical InsuranceInsurance chargesKaggle (insurance)Low-Medium (clean, 6 features, clear relationships)
Bike Sharing (UCI)Daily bike rentalsUCI ML RepositoryMedium (time features, seasonality)
DiamondsDiamond priceBuilt into seaborn (sns.load_dataset("diamonds"))Low-Medium (mix of numeric and categorical)
Used CarsCar listing priceKaggle (multiple datasets)Medium (missing values, text cleaning)
Wine QualityQuality score (3–9)UCI ML RepositoryMedium (correlated features, borderline regression/classification)
Energy EfficiencyHeating/cooling loadUCI ML RepositoryLow (clean, 8 features, strong linear signal)
Student PerformanceFinal gradeUCI ML RepositoryLow-Medium (mix of numeric and categorical)

You are not limited to this list. If you find a dataset that interests you, discuss it with your instructor before committing.

Evaluating a Dataset Before Committing

Before choosing, spend 10 minutes doing a quick scan:

import pandas as pd

df = pd.read_csv("your_dataset.csv")

# Is the target continuous?
print(df["target"].describe())
print(df["target"].nunique(), "unique values")

# How much missing data?
print(df.isnull().mean().sort_values(ascending=False).head(10))

# Any categorical columns to encode?
print(df.dtypes.value_counts())

# Is there a reasonable spread in the target?
print(df["target"].hist(bins=30))

A good dataset for this capstone has:

  • A target with at least 50 unique values (genuinely continuous)
  • Some but not excessive missing data (5–30% in some columns is fine)
  • A mix of numeric and categorical features (gives you something to encode)
  • A target distribution that isn't perfectly uniform or perfectly bimodal

Red Flags

Avoid datasets where:

  • The target is already perfectly predicted by one feature (nothing to model)
  • More than 50% of values are missing in key columns (cleaning becomes the whole project)
  • Every feature is a free-text string (requires NLP, outside scope of this capstone)
  • Fewer than 200 samples after cleaning (too small for reliable train/test splits)

Assessment Rubric

Your capstone will be evaluated on the following dimensions:

DimensionFull creditPartial creditNo credit
Problem framingClear regression problem with a specific target; motivation explainedTarget identified but motivation vagueNo clear problem statement
EDA5+ visualizations; each interpreted in writing; findings drive cleaning decisionsVisualizations present but uninterpretedOnly summary statistics; no plots
Data cleaningEvery decision documented with rationale; no silent changesSome decisions documentedChanges made without explanation
Feature engineeringAt least 2 engineered features; encoding appropriate for feature typeOne engineered featureNo feature engineering; raw data fed to model
Model training3 models trained; all evaluated with same metrics on the same test set2 models trainedOnly 1 model
EvaluationMAE, RMSE, R² reported; cross-validation used; residuals analyzedMetrics reported; no cross-validationOnly accuracy or a single metric
Hyperparameter tuningAt least one model tuned with GridSearchCV or equivalent CV-based searchManual tuning without CVNo tuning
ConclusionHonest interpretation of best model; limitations acknowledgedResults stated without interpretationNo conclusion
Code qualityNotebook runs top-to-bottom without errors; clear section structureMinor errors; mostly readableDoes not run

Timeline Guidance

This capstone spans two lessons. A suggested pace:

During Lesson 2 (Project Planning & Dataset Exploration):

  • Choose dataset and write problem statement
  • Complete EDA (all visualizations and interpretations)
  • Complete data cleaning
  • Complete feature engineering and train/test split

During Lesson 3 (Modeling & Evaluation):

  • Train and evaluate all three models
  • Tune your best model with cross-validation
  • Analyze residuals
  • Write conclusion and three-paragraph summary

What's Next

In the next lesson, you'll plan your project in detail — framing the regression problem, selecting features, performing EDA, and building a clean, engineered feature matrix ready for modeling.