7 routes42 sections324 units

Unit 2.5 · about 2 h

9 / 324

Make the experiment reproducible and explain its limits

A working notebook is not yet a reliable project. A reader should be able to understand the data boundary, reproduce the experiment and distinguish measured evidence from unsupported claims.

  • implement
  • explain

You can now

  • Save the training code, feature contract and fitted pipeline with its dependency versions.
  • Record the dataset source, license, chronological split, baseline and test metrics.
  • Write a README that explains how to reproduce the run from a clean environment.
  • State the dataset's limitations and avoid presenting the first model as a production forecast.
  • Record the exact prediction moment and the calendar-only feature contract, including why observed weather fields are excluded.

Covers

  • Reproducibility, model artifacts and technical reporting

Study, in this order

3 steps

  1. Model persistence
    Model persistence

    Read the persistence options, security considerations and version compatibility warnings before saving the pipeline.

  2. Machine Learning in Python with scikit-learn (MOOC)
    Machine Learning in Python with scikit-learn (MOOC)

    Use as the next structured learning resource after the first project; the course is free and its material is CC BY.

  3. Bike Sharing Dataset
    Bike Sharing Dataset

    Include the dataset citation and CC BY 4.0 attribution in the project README.

Focus on

  • Repository structure and clean-run instructions
  • Dataset citation, feature contract and split boundaries
  • Package versions, seeds and recorded metrics
  • Limitations, drift and the difference between a study project and production service
  • Prediction-time assumptions and the permitted calendar-only feature list

Reproduce closed-book

Clone your project into a clean directory, follow the README, run the training script and verify that it recreates the recorded metrics within the stated tolerance. Confirm the saved feature contract excludes target-derived fields, identifiers, split-only fields and observed weather.

Traps

  • Do not rely on an untracked notebook state or a local absolute path.
  • Do not save a serialized estimator without recording package versions and trust boundaries.
  • Do not claim generalization to future periods beyond the single held-out year.

Practice

scikit-learn model persistence guide

Choose a persistence method only after reading its security and version-compatibility trade-offs.

Keep the training code and data contract as the primary reproducibility record.

Self-test

  1. Why is a serialized model file insufficient as a reproducible ML project?

  2. What is the strongest claim this starter project can make?

Completion criterion

Stop when

A clean checkout can rebuild the calendar-only pipeline and reproduce the documented evaluation; the README clearly states the dataset license, prediction moment, split, feature contract, metrics and limits.

Mark passed, then open 3.1 Only mark this when you can do it without notes.

Leads to

Comes after

Resources for this unit

  • Bike Sharing Dataset
    UCI Machine Learning Repositoryrequireddataset
    Use the hourly dataset (17,389 records) for a first regression project. Sort chronologically; use 2011 for training and 2012 as the untouched final test period. cnt is the target. Exclude casual, registered, cnt, instant, dteday and yr from the model feature matrix; use dteday only to sort/split.
  • Machine Learning in Python with scikit-learn (MOOC)
    Inriasupportcourse
    Use as the free, more thorough follow-on after this guided first model. Its static course and notebooks are openly available; the materials are published under CC BY.
  • Model persistence
    scikit-learnreferencedocumentation
    Read the security and version-compatibility warnings before saving an estimator. Treat the training code, package versions, data split and metrics as the reproducible artifact, not just a serialized model file.

Also in this section

  • Introduction to Machine Learning Problem Framing
    Google for Developersprimarycourse
    Complete the short course on deciding whether ML fits the problem, framing the model output and choosing success metrics before touching the estimator.
  • Kaggle Learn — Intro to Machine Learning
    Kaggle Learnprimarycourse
    Complete the lessons on how models work, data exploration, the first model, model validation, underfitting/overfitting and random forests. Reproduce the exercises in a fresh notebook.
  • Google Machine Learning Crash Course
    Google for Developersrequiredcourse
    Use the modules on regression, numerical and categorical data, datasets/generalization/overfitting, and classification metrics as a structured conceptual companion. The course is free and includes interactive exercises.
  • Pipelines and composite estimators
    scikit-learnrequireddocumentation
    Study Pipeline and ColumnTransformer. Keep preprocessing inside the pipeline so transformations are fitted only on the training partition and applied consistently at evaluation time.
  • Common pitfalls and recommended practices
    scikit-learnrequireddocumentation
    Read the sections on inconsistent preprocessing and data leakage. Use the wrong/right examples to audit the project before trusting the reported test score.
  • TimeSeriesSplit
    scikit-learnreferencedocumentation
    Read why ordinary cross-validation can train on future observations and evaluate on the past. The starter project uses one chronological year holdout; use TimeSeriesSplit when extending it to repeated time-aware validation.
  • Model evaluation: regression metrics
    scikit-learnreferencedocumentation
    Use the regression metric definitions for MAE, MSE/RMSE and R-squared. Explain the units and limitations of each metric instead of reporting a score without context.

Quick find

Search Michi

Type to search every route, section, unit, topic and resource.

Enter opens the first result Esc closes

Reference

Keyboard shortcuts

n
Continue to the first unit not passed
j / k
Next / previous unit
1 2 3
Toggle learned, practised, passed
/
Open search
?
Show this help
Esc
Close open panels