← Back to the full chapter
Lesson

Your eight-week plan

Build a baseline, protect the holdout, and connect a prediction to the decision it informs.

2 min read80 hours practice planWeeks 6–13Updated
Read source ↗

About ten hours a week. Follow the rows in order, including the baseline and the README.

WeekFocusDo thisDone when
6Problem + splitRecheck the target and reserved split (random / time / group). Justify it before fittingREADME records the split and earlier exploration
7Baseline + leakagePrior-probability baseline (DummyClassifier). Leak preprocessing on purpose, then fix it with PipelineBefore/after scores in README
8Logistic regressionISL or scikit-learn MOOC. Pick a metric tied to costBeats the baseline, or explains why to keep the baseline
9TreesRandom forest + one boosted tree. SHAP on one wrong predictionQuality, calibration, runtime/memory and latency compared
10Calibration + thresholdReliability plot on held-out data. Tune the decision on validation costsCan explain probability and threshold separately
11APIFastAPI /predict with Pydantic validation. Test a valid and an invalid requestServed predictions match saved bundle. Bad input returns 422
12PolishConfidence intervals, a "what failed" section and a load-test noteREADME is the deliverable
13BufferRebuild one model from an empty file. Practise your leakage story for interviewsCan rebuild without a tutorial

The table uses binary classification as its first-project example. For a numeric target, use DummyRegressor, regularised linear regression, RandomForestRegressor and a boosted regressor. Swap the threshold exercise for error/interval analysis and a cost-based decision rule. The same split, holdout and API requirements apply. A well-explained negative result completes the comparison. Avoid searching for a misleading split just to beat the baseline.

For a first multiclass project, compare a class-prior baseline. Report a confusion matrix and per-class precision/recall alongside the aggregate you chose. A binary cost threshold does not carry over to several classes. Define the cost of each action/outcome pair and choose the lowest expected cost using suitable probabilities. Multilabel tasks also need their own label-level decision and evaluation design. Leave them for later if the basic workflow is new.

In your uv project, start with uv add scikit-learn. In Week 9, add the boosted-tree and SHAP packages you chose, following their official install guides, and commit the updated lock. Keep one boosted candidate. Installing three libraries is not a model comparison.


Something unclear or out of date? Suggest a correction ↗

Find your next idea

Loading local search…

Search is built from this edition. No account needed.