scikit-learn, by Fitting It

One interface, the models behind it, and the evaluation that stops you believing a number that is not real - every example fitted on the page.

23 modules Free, no login Updated 15 October 2026

About this track

scikit-learn has one interface and about two hundred algorithms behind it. fit, predict and transform are most of the API, and once they are familiar a new model is a new import and nothing else.

The harder half is not the models but knowing whether a score is real. This track spends as much time on splitting, cross-validation, pipelines and leakage as on the estimators, because that is where the mistakes are. Every editor fits a real model in your browser.

The NumPy and pandas tracks cover the arrays and frames that feed every estimator here, and the Machine Learning track covers the theory these modules apply.

What you will be able to do

How the track is ordered

The estimator API comes first, because it is the part that transfers to every model in the library. Then data - shapes, loading, and the train/test split that everything after it depends on. Regression and classification arrive next as the two shapes of supervised problem, followed immediately by evaluation, because a model without an honest score is not worth having. Preprocessing, pipelines and column handling come after that, since they are where leakage creeps in. The later modules are the estimators worth knowing, tuning, and the unsupervised pair.

Where this leads

The track ends where a real project begins: a pipeline you can cross-validate, tune and save. What comes after is mostly not scikit-learn - gradient boosting libraries, deep learning, and the deployment and monitoring that decide whether a model is any use in production.

All 23 modules, in teaching order

  1. 01fit, predict, transformLearn the fit/predict/transform interface that every scikit-learn estimator shares, and see why one API covers two hundred algorithms.
  2. 02Loading and Shaping DataLoad a dataset into a feature matrix and target vector with the exact shapes scikit-learn expects before any model can be fitted.
  3. 03Splitting Train and TestSplit data into training and test sets with train_test_split, and see why scoring a model on the data it memorised tells you nothing.
  4. 04Linear RegressionFit a linear regression, read its coefficients and intercept, and learn why the numbers are misread more often than any other model's.
  5. 05Regression MetricsCompare MAE, MSE, RMSE and R-squared on the same predictions, and see why R-squared alone rarely tells you whether a model is good enough.
  6. 06Logistic RegressionTrain a logistic regression classifier, interpret its coefficients as log-odds, and see why it is the model to try first on any problem.
  7. 07Classification MetricsChoose between accuracy, precision, recall and F1 by asking which mistakes matter most, and see why 99 percent accuracy can mean nothing.
  8. 08The Confusion MatrixBuild a confusion matrix from predictions, name each of the four cells, and compute precision, recall and F1 from them by hand.
  9. 09Probabilities and ThresholdsMove the classification threshold away from 0.5, plot a precision-recall curve, and decide the cut-off that matches your cost trade-off.
  10. 10Class ImbalanceHandle datasets where the interesting class is rare, compare four remedies and measure each one with the metric that actually fits.
  11. 11Cross-ValidationReplace a single train/test split with cross-validation to see the variance behind every score and pick a model you can trust.
  12. 12Overfitting and UnderfittingSpot overfitting and underfitting from training and test scores, and apply the opposite fix each failure needs to close the gap.
  13. 13Scaling FeaturesScale features with StandardScaler and MinMaxScaler, and learn which models break without scaling and which ignore it entirely.
  14. 14Encoding CategoriesTurn categorical columns into numbers with OrdinalEncoder and OneHotEncoder, and learn which choice invents a fact and which does not.
  15. 15Missing ValuesFill gaps in your data with SimpleImputer, understand when the gap itself carries information, and keep imputation inside a pipeline.
  16. 16Pipelines in scikit-learnChain preprocessing and a model into one Pipeline so every transformation fits on training data only and every score stays honest.
  17. 17Different Columns, Different TreatmentApply different preprocessing to different columns using ColumnTransformer, so numeric features scale while categoricals encode.
  18. 18Leakage in a scikit-learn WorkflowSpot data leakage before it inflates your score: learn the patterns that let test information leak into training and how pipelines prevent them.
  19. 19Decision TreesFit a decision tree, read its splits as plain rules, and see why a single tree overfits and how pruning brings it back.
  20. 20Random ForestsCombine hundreds of decision trees into a random forest that averages out each tree's instability and resists overfitting.
  21. 21Hyperparameter SearchSearch for the best hyperparameters with GridSearchCV and RandomizedSearchCV, and measure each combination fairly with cross-validation.
  22. 22k-Means ClusteringGroup data points into clusters with k-means, measure fit with inertia and silhouette score, and see how the algorithm converges.
  23. 23A Complete WorkflowFollow one dataset through loading, splitting, scaling, encoding, fitting and scoring to see every scikit-learn step in context.

Other tracks