ML Fundamentals — scikit-learn Pipeline

Insight

A split reproducible without a seed (Train (8, 5), Test (2, 5)), four synthetic datasets and 21 tests (7 + 9 + 5) that keep the pipeline runnable

Interactive: every figure is computed from the project’s own data, so you can move the controls instead of taking the sentence on trust.

What the case measured

  • Synthetic data data
  • Live demo
  • Open code
  • 5 tools in the stack stack
Situation
Preprocessing is the foundation of all later ML work: a test leak into training or hand-rolled imputation invalidates every model above it
Task
Build preprocessing correctly for modern scikit-learn: no leakage, no reliance on a random seed, reproducible at every pipeline stage
Action
ColumnTransformer (SimpleImputer → StandardScaler for numerics, OneHotEncoder for categoricals) fit on train only; a deterministic split by sorting on (Country, Age); a dataset generator and EDA plots
Result
A split reproducible without a seed (Train (8, 5), Test (2, 5)), four synthetic datasets and 21 tests (7 + 9 + 5) that keep the pipeline runnable
Stack
Pythonscikit-learnpandasmatplotlibpytest
Source View on GitHub → Updated: Nov 1, 2026

▶ Data-flow diagram — self-contained HTML, opens in a browser — no install, no build

Situation

Every later ML task — regression, classification, clustering — rests on preprocessing. If the test set leaks into training, or missing values are handled by hand, any model further up the stack is invalidated and the result no longer reproduces on another machine.

The Machine Learning A-Z course supplies the structure, but its code (sklearn.cross_validation, Imputer, OneHotEncoder(categorical_features=)) was removed from scikit-learn in 0.22 — it has to be migrated to the modern API.

Task

I needed the preprocessing built correctly for modern scikit-learn: no leakage into training, no reliance on a random seed, and reproducible at every stage of the pipeline.

Want an analyst who works like this?

Tell me the role and the problems in it — I reply within a day. Need this reasoning applied to your data rather than a hire? That works too.

Send a request