ML Atlas

Course · 33 of 38 lessons ready · 385 min

Machine learning from zero

Short lessons that take you from “what is a model?” to how a language model picks the next word. In every lesson you change something in a live lab on real data, watch the model react and check yourself with three questions. No code needed.

Start lesson 0.1

Lessons

Seven modules: from the whole journey on one dataset to a model out in the world. Lessons without a link are still being written.

Module 0 · The whole game

What does the whole journey from a question to an evaluation look like?

  1. 0.1The whole process in 15 minutes, start to finishThe whole path of a machine learning project on one dataset: question, data, split, guessing, model and evaluation. Without a baseline a score means nothing.15 min · Interactive

Module 1 · How a model learns from examples

Where does a model get its rule, and what do you compare it with?

  1. 1.1What is machine learning?Machine learning lets a program find its rule in examples instead of having a person write it. The lesson shows the difference on real breast tumour data.10 min · Interactive
  2. 1.2Data, features, labels and splitsA dataset is a table of examples, features and labels. Why the test set must stay hidden, and why its size decides how much a score can be trusted.10 min · Interactive
  3. 1.3Baselines: what do you compare your model with?Before praising a model, compute the score without learning: the top class or the mean. When the sick are rare, “always healthy” scores high and finds no one.12 min · Interactive
  4. 1.4Nearest neighbours: the simplest modelkNN learns no rule: a new case gets the label held by most of its k nearest examples. The number k shapes the borders, and the units decide who counts as near.12 min · Interactive
  5. 1.5Linear regression: fitting a lineLinear regression draws the straight line that misses the data least. On diabetes data, mean squared error decides which line is best.10 min · Interactive
  6. 1.6Gradient descent: learning by small stepsGradient descent finds good parameters by repeatedly stepping downhill on the error. The learning rate decides between progress and explosion.10 min · Interactive

Module 2 · Classification and evaluation

When is a result good, and for whom?

  1. 2.1Classification: drawing a boundaryA classifier turns measurements into a category. Logistic regression gives a probability and a boundary; the lesson shows both on two penguin species.10 min · Interactive
  2. 2.2Evaluating a classifier: beyond accuracyAccuracy hides which mistakes a model makes. The confusion matrix, precision and recall reveal the trade-off a threshold creates on tumour data.10 min · Interactive
  3. 2.3Thresholds, ROC and PR: every threshold at onceROC and precision–recall curves show every threshold at once. When a class is rare, ROC AUC hardly moves while AP falls, because false alarms eat precision.12 min · Interactive
  4. 2.4Calibration: does 0.8 mean 80%?A model can sort well yet give wrong percentages. Naive Bayes declares 98% confidence and is right 88% of the time. Temperature fixes this, decisions stay.12 min · Interactive
  5. 2.5Imbalanced classesWhen one class is rare, accuracy hides the losses and the model learns to say “the common class”. Recall, balanced accuracy and class weights show and patch it.12 min · Interactive
  6. 2.6A metric and threshold for the cost of mistakesPick the threshold by the price of mistakes, not by habit. When a miss costs 10 times more than a false alarm, the cheapest threshold lies near 0.09, not 0.5.12 min · Interactive
  7. Project A: screeningYour first portfolio project: pick a model and a threshold for screening when a miss costs 10 false alarms, then check your choice on a hidden test.Project · 40 min

Module 3 · Generalisation

Will the model work tomorrow, on new data?

  1. 3.1Overfitting: when a model memorisesA flexible model can fit its training data perfectly and still fail on new data. As a polynomial's degree rises, training and test error part ways.10 min · Interactive
  2. 3.2Validation and cross-validationChoosing settings with the test set spoils it. Cross-validation tests a model on every part of the data in turn and shows how stable its score really is.10 min · Interactive
  3. 3.3Learning curves: more data or a better model?Learning curves show the training and validation score as the data grow. Their shape tells you whether to collect more data or switch to a richer model.12 min · Interactive
  4. 3.4Regularisation: ridge and lassoA penalty on large weights calms a model. Ridge shrinks every weight, lasso zeroes them one by one: with 3 of 10 features test R² falls from 0.470 to 0.386.12 min · Interactive
  5. 3.5Tuning hyperparameters without cheatingThe best of 9 tree settings scores 93.7% in cross-validation and 88.3% on new biopsies. Picking the winner inflates its score, just as picking the seed does.14 min · Interactive
  6. 3.6Early stoppingA network trained too long memorises wrong labels. With 20% random labels, 100 epochs instead of early stopping cut test accuracy from 86.1% to 76.3%.12 min · Interactive

Module 4 · Data in practice

What breaks models before you even start?

  1. 4.1Exploration: look before you modelFour data sets with the same mean, correlation 0.82 and line look nothing alike. Draw the data before you trust the numbers and before you build a model.12 min · Interactive
  2. 4.2Missing dataDrop rows with a gap and 333 of 344 penguins remain. When the heaviest lack BMI, the mean in the gaps weakens the link with disease; the gap itself says a lot.12 min · Interactive
  3. 4.3Categories and scalingkNN on wines scores 0.695 without scaling and 0.963 after standardising. Islands written as 0, 1, 2 fake an order: one-hot lifts R² from 0.469 to 0.546.12 min · Interactive
  4. 4.4Feature engineeringCultivar 2 sits mid-axis and no threshold cuts it out. A new column x² gives 77.4% instead of 60.4%; 200 noise columns drag kNN from 98.1% to 77.4%.12 min · Interactive
  5. 4.5Data leakageLeakage is information from the test or the future that reaches a model's training. On pure noise it fakes 82% in validation. Learn 8 types and find them.14 min · Interactive
  6. 4.6Pipelines: from a table to a predictionThe scaler is part of the model and learns on the training only. Fitted on the test itself, it gives 44.1% instead of 99.0% for penguins arriving one by one.14 min · Interactive
  7. Project B: a clean tableSecond portfolio project: from a raw penguin table (gaps, categories) build a pipeline that does not leak, then find the leak in three other people’s pipelines.Project · 45 min

Module 5 · Models that win on tables

Which model, when and why?

  1. 5.1Decision trees: twenty questions with dataA decision tree classifies by asking yes-or-no questions, each chosen to split the data as cleanly as possible. The example: who survived the Titanic.10 min · Interactive
  2. 5.2Ensembles: why many trees beat oneAn ensemble combines many imperfect models whose errors partly cancel out. That is why a random forest becomes more accurate and stable with more trees.10 min · Interactive
  3. 5.3Gradient boosting: trees that fix each other’s errorsEvery tree fixes the errors of the ones before it. After 200 trees at step 1 training falls to 2287, while the test rises to 5944, worse than a line (4095).12 min · Interactive
  4. 5.4Naive Bayes: a false assumption, good decisionsNaive Bayes assumes independent features. On iris petals (r = 0.80) it gets 93.3% right, but on 171 validation tumours it declares 98.3% at 88.3% accuracy.12 min · Interactive
  5. 5.5Support vector machines and kernelsAn SVM looks for the widest band between the classes. As C grows from 0.01 to 100 the band shrinks from 3.9 to 0.15 cm and the test barely moves.12 min · Interactive
  6. 5.6Which model when?Five models, five datasets, 20 splits. No model is at the top everywhere, and a gap of 0.3 points can be a draw: 10 splits against 7.12 min · Interactive
  7. Project C: a mini competition in the browserProject · Coming soon

Module 6 · No teacher, interpretation, the model in the world

What does a model do without labels, what does it look at, and what happens after deployment?

  1. k-means: groups without labelsComing soon
  2. PCA: fewer dimensions, the same contentComing soon
  3. Anomaly detectionComing soon
  4. What does the model look at? Feature importanceComing soon
  5. After deployment: drift and fairnessComing soon
  6. Project D: explain a modelProject · Coming soon

Bridge (optional): Neural networks and language models

What next: a step towards networks and large language models.

The whole course: Neural networks from the inside (PL) · 12 lessons

  1. 7.1Neural networks: many simple units togetherA neural network stacks simple units that each draw one line and bend it. More hidden units let the decision regions curve around iris flowers.12 min · Interactive
  2. 7.2From neural networks to large language modelsA large language model is trained to guess the next token. The lesson builds the idea from a word-counting model and shows how temperature changes its output.12 min · Interactive

This course in other languages

Polski · Kurs uczenia maszynowego od zeraEspañol · Machine learning desde ceroDeutsch · Machine Learning von Grund aufFrançais · Le machine learning en partant de zéroPortuguês · Machine learning do zero