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.
01 · What is Machine Learning?
Rules versus examples, the kinds of learning problems, the shape of a dataset and the workflow of a project.
- 1.1What is machine learning?Hand-written rules versus rules learned from examples, and where ML sits inside AI.~20 min
- 1.2Types of learning problemsSupervised, unsupervised and reinforcement learning; classification versus regression.~20 min
- 1.3Data, features and labelsSamples, features and labels, and how they become the matrix X and the vector y.~18 min
- 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
The numerical tools you need for everything that follows, with small exercises you run in the browser.
- 2.1numpy arraysArrays, shape and dtype, vectorisation instead of loops, reshaping and axes.~18 min
- 2.2Indexing and broadcastingSlicing, boolean masks and broadcasting for selecting and combining data.~18 min
- 2.3Statistics and correlationMean, median, standard deviation, Pearson correlation and seeded randomness.~20 min
- 2.4pandas essentialsDataFrames, filtering, grouping and quick summaries with describe.~18 min
- 2.5Linear algebra, just enoughVectors, dot products, matrix-vector products and shapes.~16 min
03 · Linear regression and gradient descent
Your first real model: fit a line, measure the error, learn the parameters with gradient descent, then do it with scikit-learn.
- 3.1Fitting a lineParameters, predictions, residuals and the MSE and MAE loss functions.~18 min
- 3.2Gradient descentStep downhill on the loss, and the effect of the learning rate.~22 min
- 3.3Linear regression with numpyThe design matrix and the normal equation, checked against a reference.~22 min
- 3.4Linear regression with scikit-learnThe fit, predict and score pattern, coefficients and the R-squared score.~18 min
- 3.5Multiple features and scalingSeveral features, standardisation and why scaling helps gradient descent.~20 min
04 · Generalization and evaluation
Will the model work on data it has never seen? Splits, overfitting, cross-validation, regularisation, metrics and leakage.
- 4.1Train and test setsWhy we hold data out, and how to split with random_state and stratify.~18 min
- 4.2Overfitting and underfittingReading train and test error, and the bias and variance trade-off.~22 min
- 4.3Cross-validationK-fold evaluation, its spread, and when to shuffle or stratify.~20 min
- 4.4RegularizationRidge and Lasso penalties and choosing alpha with held-out data.~20 min
- 4.5Regression metricsMAE, RMSE, R-squared, residuals and baselines.~18 min
- 4.6Data leakageHow information leaks into training, and how pipelines prevent it.~22 min
05 · Classification
Logistic regression, nearest neighbours, honest classification metrics, text classification and multiclass problems.
- 5.1Logistic regressionThe sigmoid, probabilities, thresholds and linear decision boundaries.~22 min
- 5.2k-nearest neighboursDistance-based voting, scaling and choosing k.~20 min
- 5.3Confusion matrix and metricsAccuracy, precision, recall, F1 and the threshold trade-off.~22 min
- 5.4ROC, AUC and imbalanced classesRates at every threshold, AUC and class weights.~22 min
- 5.5Naive Bayes and textBag of words, TF-IDF and a spam classifier.~20 min
- 5.6Multiclass classificationOne-vs-rest, softmax and reading a 10 by 10 confusion matrix.~20 min
06 · Data preparation and pipelines
Missing values, categorical encoding, scaling, feature engineering, and leak-proof pipelines for real tables.
- 6.1Missing valuesFind, impute or flag missing data without leaking test information.~20 min
- 6.2Encoding categorical featuresOne-hot and ordinal encoding, and categories unseen in training.~18 min
- 6.3Scaling and normalizationStandard, min-max and robust scaling, and log transforms for skewed data.~20 min
- 6.4Feature engineering and selectionRatios, interactions, polynomial terms and univariate selection.~20 min
- 6.5Pipelines and ColumnTransformerDifferent preprocessing per column inside one leak-proof pipeline.~22 min
07 · Trees, ensembles and SVMs
Decision trees, random forests, gradient boosting, support vector machines and feature importance.
- 7.1Decision treesGini impurity, growing and limiting a tree, and reading its rules.~22 min
- 7.2Random forestsBagging, bootstrap samples, the random forest and the out-of-bag score.~22 min
- 7.3Gradient boostingTrees that correct each other, rounds and the learning rate.~22 min
- 7.4Support vector machinesMaximum margin, the C parameter and kernels.~20 min
- 7.5Feature importanceImpurity and permutation importance, and correlated features.~20 min
08 · Model selection and tuning
Hyperparameter search, baselines and fair comparison, learning curves and cost-sensitive decisions.
- 8.1Hyperparameters and searchGrid and randomised search, and keeping the test set honest.~22 min
- 8.2Baselines and model comparisonTrivial baselines and fair comparisons under identical folds.~20 min
- 8.3Learning curvesBias versus variance, and more data versus a better model.~20 min
- 8.4Cost-sensitive decisionsChoosing a threshold from the costs of mistakes or a recall target.~22 min
09 · Unsupervised learning
Clustering, dimensionality reduction and anomaly detection when you have features but no target labels.
- 9.1k-means clusteringCentroids, Lloyd’s algorithm, inertia and partitioning data without labels.~22 min
- 9.2Choosing k: elbow and silhouetteThe elbow method, inertia curves, the silhouette score and diagnosing clusters.~20 min
- 9.3Hierarchical clustering and DBSCANDendrograms, density-based clusters, epsilon neighbourhoods and noise points.~22 min
- 9.4Principal component analysisOrthogonal projections, covariance, explained variance ratio and compression.~22 min
- 9.5Anomaly detectionFinding outliers with z-scores, multivariate distributions and IsolationForest.~20 min
10 · Neural networks and deep learning
From single artificial neurons to multi-layer perceptrons, backpropagation, and modern architectures.
- 10.1The artificial neuronWeights, biases, linear combinations, step functions, and the XOR limitation.~22 min
- 10.2Layers and activationsWhy depth needs non-linearities: ReLU, Sigmoid, and Softmax.~20 min
- 10.3BackpropagationThe chain rule in action, calculating gradients, and stochastic gradient descent.~22 min
- 10.4MLP from scratch with NumPyForward pass, backward pass, and conquering XOR in pure NumPy.~25 min
- 10.5Neural networks with scikit-learnMLPClassifier, loss curves, scaling, and early stopping on real tabular data.~22 min
- 10.6The deep learning landscapeCNNs for images, Transformers for language, GPUs, and moving to PyTorch.~20 min
11 · Responsible ML, explainability and capstones
Fairness metrics, model interpretability, drift monitoring, and two complete end-to-end capstones.
- 11.1Bias and fairnessDemographic parity, equalized odds, disparate impact, and proxy correlations.~22 min
- 11.2Model explainabilityPermutation importance, partial dependence plots, and local SHAP explanations.~22 min
- 11.3Deploying and monitoringPipeline serialization with joblib, security risks, data drift, and concept drift.~22 min
- 11.4Capstone: End-to-end regressionA complete regression project: baseline, leak-free pipeline, 5-fold CV, and residuals.~25 min
- 11.5Capstone: Imbalanced classificationA complete classification project: stratified splits, PR AUC, and cost-sensitive thresholds.~25 min
Paths featuring Machine Learning: from first principles to practice
Recommended next courses
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.