Home / Learn / Data & AI / ML foundations
All lessons

From a straight line to an LLM: data analytics and machine learning foundations

How machines learn from data, from drawing the best straight line to what a large language model really is. Linear and logistic regression, decision trees, random forests, boosting, clustering, neural networks and transformers, each with pictures, simulations you can play with and the maths worked by hand.

For students from Class 11 up, career changers and anyone starting in data. School maths is enough: Module 1 teaches the rest. Free, no sign-up. All 66 lessons, about 25.3 hours.

Quick reference: glossary of terms · formula cheat sheet

What you will be able to do

  • Explain every common model in plain words and with its formula: linear and logistic regression, k-nearest neighbours, naive Bayes, decision trees, random forests, gradient boosting, k-means, PCA and neural networks.
  • Work the maths by hand on small numbers: least squares, gradient descent, Gini impurity, the chain rule in backpropagation and softmax in attention.
  • Judge a model honestly: train and test sets, cross-validation, precision and recall, overfitting and data leakage.
  • Say what an LLM really is: embeddings, attention and next-word training, and what that means for what it can and cannot do.

Every lesson has a picture of the idea, a simulation to play with, a maths box with a worked example, practice questions and a short quiz. It is the first step before the Pipeline to Dashboard and Data at Scale courses, and before Offline AI, where you run a language model on your own computer.

0 of 66 lessons done

Without the tick, your progress lasts until you close this tab. Either way it stays in this browser: there is no sign-up and nothing is sent to us.

All modules

Part A: Data and the maths you need

1 Data, models and the maths you need 7 lessons

  1. 1.1 What data analytics and machine learning are
  2. 1.2 Data, features, labels and models
  3. 1.3 Functions, slopes and straight lines
  4. 1.4 Vectors and the dot product
  5. 1.5 Derivatives and the gradient: which way is downhill
  6. 1.6 Probability, mean, variance and the normal curve
  7. 1.7 The machine learning workflow

2 Looking at data before modelling 5 lessons

  1. 2.1 Types of data: numbers, categories, text and time
  2. 2.2 Summaries and charts that tell the truth
  3. 2.3 Correlation is not causation
  4. 2.4 Cleaning: missing values, outliers and scaling
  5. 2.5 Train, validation and test sets

Part B: Models that draw lines

3 Linear regression: the first model 8 lessons

  1. 3.1 What a linear model is
  2. 3.2 Least squares: why we square the errors
  3. 3.3 Fitting by gradient descent
  4. 3.4 Many inputs: multiple regression and matrices
  5. 3.5 Measuring fit: residuals, RMSE and R²
  6. 3.6 Curves with a linear model: polynomial features
  7. 3.7 Overfitting and underfitting
  8. 3.8 Regularisation: ridge and lasso

4 Classification and logistic regression 8 lessons

  1. 4.1 Predicting a category
  2. 4.2 The sigmoid and odds: from a line to a probability
  3. 4.3 Log-loss: how logistic regression learns
  4. 4.4 Decision boundaries
  5. 4.5 Accuracy is not enough: precision, recall and F1
  6. 4.6 Thresholds, ROC curves and AUC
  7. 4.7 k-nearest neighbours
  8. 4.8 Naive Bayes: counting words to catch spam

Part C: Trees and forests

5 Decision trees 5 lessons

  1. 5.1 Twenty questions: how a tree decides
  2. 5.2 Purity: Gini impurity and entropy
  3. 5.3 Information gain: choosing the best split
  4. 5.4 Trees that predict numbers
  5. 5.5 Deep trees overfit: depth limits and pruning

6 Ensembles: random forests and boosting 6 lessons

  1. 6.1 Wisdom of crowds: why many models beat one
  2. 6.2 Bagging and bootstrap samples
  3. 6.3 Random forests
  4. 6.4 Feature importance, and what it does not tell you
  5. 6.5 Boosting: each model fixes the last one's mistakes
  6. 6.6 Gradient boosting

7 Judging models honestly 5 lessons

  1. 7.1 Bias and variance
  2. 7.2 Cross-validation
  3. 7.3 Hyperparameters and tuning
  4. 7.4 Data leakage: the most common mistake
  5. 7.5 Fairness and explaining predictions

Part D: Patterns, networks and language

8 Finding patterns without labels 5 lessons

  1. 8.1 Clustering with k-means
  2. 8.2 Choosing k: elbow and silhouette
  3. 8.3 Hierarchical clustering and dendrograms
  4. 8.4 PCA: squashing many columns into two
  5. 8.5 Finding the odd one out: anomaly detection

9 Neural networks 7 lessons

  1. 9.1 The perceptron: a neuron as a weighted vote
  2. 9.2 Activation functions
  3. 9.3 Layers: why stacking neurons can draw any shape
  4. 9.4 Backpropagation: the chain rule, step by step
  5. 9.5 Training: loss, batches, epochs and learning rate
  6. 9.6 Images: convolution and filters
  7. 9.7 Sequences: why order matters

10 From words to an LLM 7 lessons

  1. 10.1 Text as numbers: bag of words and TF-IDF
  2. 10.2 Embeddings: meaning as distance
  3. 10.3 Predicting the next word
  4. 10.4 Attention: each word looks at the others
  5. 10.5 The transformer block
  6. 10.6 How an LLM is trained
  7. 10.7 What an LLM is, and what it is not

11 Capstone and next steps 3 lessons

  1. 11.1 Capstone: predict shop sales from a CSV
  2. 11.2 Which model when
  3. 11.3 Where to go next