Skip to main content

Interactive course

Machine Learning: from first principles to practice

A progressive, hands-on course: build intuition with small interactive simulations, then train real models with Python and scikit-learn directly in your browser.

See how machines learn from data, one small experiment at a time.

Playground Machine Learning: from first principles to practiceFree interactive environmentCheatsheetQuick syntax referenceML Model Arena: The Overfitting TrapDefeat the deadly traps of Machine Learning: data leakage, class imbalance, and overfitting on high-dimensional data.

01 · What is Machine Learning?

4 lessons

Rules versus examples, the kinds of learning problems, the shape of a dataset and the workflow of a project.

  1. 1.1What is machine learning?Hand-written rules versus rules learned from examples, and where ML sits inside AI.~20 min
  2. 1.2Types of learning problemsSupervised, unsupervised and reinforcement learning; classification versus regression.~20 min
  3. 1.3Data, features and labelsSamples, features and labels, and how they become the matrix X and the vector y.~18 min
  4. 1.4The machine learning workflowFrom problem to production: split, train, evaluate and monitor, plus your first metric.~22 min

02 · Toolkit: numpy, statistics and pandas

5 lessons

The numerical tools you need for everything that follows, with small exercises you run in the browser.

  1. 2.1numpy arraysArrays, shape and dtype, vectorisation instead of loops, reshaping and axes.~18 min
  2. 2.2Indexing and broadcastingSlicing, boolean masks and broadcasting for selecting and combining data.~18 min
  3. 2.3Statistics and correlationMean, median, standard deviation, Pearson correlation and seeded randomness.~20 min
  4. 2.4pandas essentialsDataFrames, filtering, grouping and quick summaries with describe.~18 min
  5. 2.5Linear algebra, just enoughVectors, dot products, matrix-vector products and shapes.~16 min

03 · Linear regression and gradient descent

5 lessons

Your first real model: fit a line, measure the error, learn the parameters with gradient descent, then do it with scikit-learn.

  1. 3.1Fitting a lineParameters, predictions, residuals and the MSE and MAE loss functions.~18 min
  2. 3.2Gradient descentStep downhill on the loss, and the effect of the learning rate.~22 min
  3. 3.3Linear regression with numpyThe design matrix and the normal equation, checked against a reference.~22 min
  4. 3.4Linear regression with scikit-learnThe fit, predict and score pattern, coefficients and the R-squared score.~18 min
  5. 3.5Multiple features and scalingSeveral features, standardisation and why scaling helps gradient descent.~20 min

04 · Generalization and evaluation

6 lessons

Will the model work on data it has never seen? Splits, overfitting, cross-validation, regularisation, metrics and leakage.

  1. 4.1Train and test setsWhy we hold data out, and how to split with random_state and stratify.~18 min
  2. 4.2Overfitting and underfittingReading train and test error, and the bias and variance trade-off.~22 min
  3. 4.3Cross-validationK-fold evaluation, its spread, and when to shuffle or stratify.~20 min
  4. 4.4RegularizationRidge and Lasso penalties and choosing alpha with held-out data.~20 min
  5. 4.5Regression metricsMAE, RMSE, R-squared, residuals and baselines.~18 min
  6. 4.6Data leakageHow information leaks into training, and how pipelines prevent it.~22 min

05 · Classification

6 lessons

Logistic regression, nearest neighbours, honest classification metrics, text classification and multiclass problems.

  1. 5.1Logistic regressionThe sigmoid, probabilities, thresholds and linear decision boundaries.~22 min
  2. 5.2k-nearest neighboursDistance-based voting, scaling and choosing k.~20 min
  3. 5.3Confusion matrix and metricsAccuracy, precision, recall, F1 and the threshold trade-off.~22 min
  4. 5.4ROC, AUC and imbalanced classesRates at every threshold, AUC and class weights.~22 min
  5. 5.5Naive Bayes and textBag of words, TF-IDF and a spam classifier.~20 min
  6. 5.6Multiclass classificationOne-vs-rest, softmax and reading a 10 by 10 confusion matrix.~20 min

06 · Data preparation and pipelines

5 lessons

Missing values, categorical encoding, scaling, feature engineering, and leak-proof pipelines for real tables.

  1. 6.1Missing valuesFind, impute or flag missing data without leaking test information.~20 min
  2. 6.2Encoding categorical featuresOne-hot and ordinal encoding, and categories unseen in training.~18 min
  3. 6.3Scaling and normalizationStandard, min-max and robust scaling, and log transforms for skewed data.~20 min
  4. 6.4Feature engineering and selectionRatios, interactions, polynomial terms and univariate selection.~20 min
  5. 6.5Pipelines and ColumnTransformerDifferent preprocessing per column inside one leak-proof pipeline.~22 min

07 · Trees, ensembles and SVMs

5 lessons

Decision trees, random forests, gradient boosting, support vector machines and feature importance.

  1. 7.1Decision treesGini impurity, growing and limiting a tree, and reading its rules.~22 min
  2. 7.2Random forestsBagging, bootstrap samples, the random forest and the out-of-bag score.~22 min
  3. 7.3Gradient boostingTrees that correct each other, rounds and the learning rate.~22 min
  4. 7.4Support vector machinesMaximum margin, the C parameter and kernels.~20 min
  5. 7.5Feature importanceImpurity and permutation importance, and correlated features.~20 min

08 · Model selection and tuning

4 lessons

Hyperparameter search, baselines and fair comparison, learning curves and cost-sensitive decisions.

  1. 8.1Hyperparameters and searchGrid and randomised search, and keeping the test set honest.~22 min
  2. 8.2Baselines and model comparisonTrivial baselines and fair comparisons under identical folds.~20 min
  3. 8.3Learning curvesBias versus variance, and more data versus a better model.~20 min
  4. 8.4Cost-sensitive decisionsChoosing a threshold from the costs of mistakes or a recall target.~22 min

09 · Unsupervised learning

5 lessons

Clustering, dimensionality reduction and anomaly detection when you have features but no target labels.

  1. 9.1k-means clusteringCentroids, Lloyd’s algorithm, inertia and partitioning data without labels.~22 min
  2. 9.2Choosing k: elbow and silhouetteThe elbow method, inertia curves, the silhouette score and diagnosing clusters.~20 min
  3. 9.3Hierarchical clustering and DBSCANDendrograms, density-based clusters, epsilon neighbourhoods and noise points.~22 min
  4. 9.4Principal component analysisOrthogonal projections, covariance, explained variance ratio and compression.~22 min
  5. 9.5Anomaly detectionFinding outliers with z-scores, multivariate distributions and IsolationForest.~20 min

10 · Neural networks and deep learning

6 lessons

From single artificial neurons to multi-layer perceptrons, backpropagation, and modern architectures.

  1. 10.1The artificial neuronWeights, biases, linear combinations, step functions, and the XOR limitation.~22 min
  2. 10.2Layers and activationsWhy depth needs non-linearities: ReLU, Sigmoid, and Softmax.~20 min
  3. 10.3BackpropagationThe chain rule in action, calculating gradients, and stochastic gradient descent.~22 min
  4. 10.4MLP from scratch with NumPyForward pass, backward pass, and conquering XOR in pure NumPy.~25 min
  5. 10.5Neural networks with scikit-learnMLPClassifier, loss curves, scaling, and early stopping on real tabular data.~22 min
  6. 10.6The deep learning landscapeCNNs for images, Transformers for language, GPUs, and moving to PyTorch.~20 min

11 · Responsible ML, explainability and capstones

5 lessons

Fairness metrics, model interpretability, drift monitoring, and two complete end-to-end capstones.

  1. 11.1Bias and fairnessDemographic parity, equalized odds, disparate impact, and proxy correlations.~22 min
  2. 11.2Model explainabilityPermutation importance, partial dependence plots, and local SHAP explanations.~22 min
  3. 11.3Deploying and monitoringPipeline serialization with joblib, security risks, data drift, and concept drift.~22 min
  4. 11.4Capstone: End-to-end regressionA complete regression project: baseline, leak-free pipeline, 5-fold CV, and residuals.~25 min
  5. 11.5Capstone: Imbalanced classificationA complete classification project: stratified splits, PR AUC, and cost-sensitive thresholds.~25 min
Frequently asked questions

Machine Learning: from first principles to practice FAQ

How many lessons and hands-on exercises are in Machine Learning: from first principles to practice?

Machine Learning: from first principles to practice covers 11 modules, 56 interactive lessons, and 287 practical exercises (~19 hours total) with instant automated validation.

Do I need local setup or IDE installation for Machine Learning: from first principles to practice?

No installation required: every exercise and the interactive Machine Learning: from first principles to practice playground execute right in your browser via WASM and isolated sandboxes, with instant feedback.

Is Module 1 of Machine Learning: from first principles to practice free without creating an account?

Yes. Module 1 (“Module 1 — What is Machine Learning?”), the live playground, and the printable cheatsheet are permanently free without signup, saving your progress locally in your browser.

Which career learning paths include Machine Learning: from first principles to practice?

Machine Learning: from first principles to practice is a core building block of AI Engineering & Machine Learning, targeting roles such as AI Engineer · ML Engineer · LLM Systems Engineer.