Lesson 3.14core6 h

Project: end-to-end tabular ML with scikit-learn

From a CSV to a portfolio-quality notebook

Everything in Phase 3 becomes real only when you ship a complete project: framing, EDA, leakage-safe pipelines, honest cross-validation, a tuned gradient-boosted model, interpretation and a write-up. This is the first entry in your portfolio ladder (11.3 Portfolio project ladder) and the template you will reuse for every later project, from image classifiers (5.10 Project: train and deploy an image classifier) to RAG systems (9.11 Project: a cited RAG assistant over your own documents, with evals).

You'll be able to

  • Frame a tabular prediction problem with a clear metric, baseline and validation protocol
  • Build a leakage-safe preprocessing + model pipeline with ColumnTransformer and cross-validation
  • Tune a gradient-boosted model with early stopping and compare it against linear and forest baselines
  • Interpret the model with SHAP, run error analysis, and write a reproducible, readable report

Key ideas

  1. Frame first: target, unit of prediction, metric, intended use, and a trivial baseline.
  2. Hold out a test set immediately and touch it once at the end; use stratified or time-based splits as the data demands.
  3. Put every preprocessing step inside a Pipeline/ColumnTransformer so cross-validation stays leakage-free.
Show 3 more key ideas
  1. Compare models under one protocol and report CV mean ± std; a tuned GBDT with early stopping is the usual winner on tabular data.
  2. Interpret with permutation importance and SHAP; read the worst 30 validation errors and turn patterns into actions.
  3. A portfolio project is reproducible (seeds, lockfile, one command) and communicates framing, validation, results, limitations.

Suggested path through this lesson