IRAnimated Machine Learning Algorithms Engineering AI with Clarity ★ Star on GitHub

MACHINE LEARNING, ANIMATED

Watch the algorithm itself learn.
Then watch it explain every prediction.

21 scikit-learn models learn California house prices and Titanic survival, two classic datasets you already know, frame by frame. Every frame is a real model state, and every prediction is worked out and checked against the model's own answer. The black box, opened.

  • 76videos
  • 21models
  • 2classic datasets
  • ✓every prediction checked
Four of the videos looping: a decision tree growing,
  gradient boosting explaining a Titanic passenger, a lesson's 3-D view, and four models learning who survived
Real clips from the gallery below. Every frame comes from a real training state.

🆚 Why this is different from other ML explainers

Most explainers show you an idea of an algorithm. This shows you the algorithm itself, running.

📺 Most ML explainers 🎬 Here
🎨 Hand-animated or idealised curves, drawn to look right 🔁 Every frame is a snapshot of a real scikit-learn model, taken during real training
🧸 Synthetic blobs, generated to behave for the demo 📚 Two classic datasets of real records, familiar on purpose: 20,640 California census districts and 1,309 Titanic passengers. You already know the data, so all your attention goes to the algorithm
🏁 The finished model only 🎞️ A model's whole life: data → first guess → training → final model → inference → test exam
📉 A loss curve and an accuracy number 🔍 The internals themselves: weights, splits, votes, support vectors, bell curves, activations
🪄 "The model says 0.82", taken on trust ✅ The prediction worked out step by step, and checked against the model's own predict before it may show ✓
🧮 After-the-fact approximations of what the model did 🧠 The model's own parameters, read straight from the fitted estimator
🔬 One algorithm at a time, each on its own example ⚖️ Many models on the same data, side by side: races, landscapes, a scoreboard
🤷 Training accuracy, or no score at all 🧪 Train vs validation vs held-out test, no leakage, and statistical tests before any "better"
👀 Watch-only 🛠️ Open source and reproducible: one command regenerates any video, and tests guard every rule

🎁 What you'll get out of it

If you are… You'll walk away with…
🌱 An ML enthusiast or student Intuition that formulas alone don't give: why a deep tree over-fits, why boosting takes many small steps, why KNN "learns" nothing, and what a neural network's weights actually do.
🧑‍💻 A data scientist or ML engineer A sharper eye for model behaviour as it happens: bias and variance in motion, regularisation paths, overconfident scores, and honest evaluation habits (validation for choices, the test set once).
🏢 A lead who explains models to stakeholders Pictures that answer "why did the model say that?" for a single case, with numbers that match the model exactly.
🧑‍🏫 An educator or content creator Ready-made 108-second lessons, one algorithm each, that work with the sound off, plus the code to make your own.
💼 Someone preparing for interviews A visual memory of 20+ algorithms: how each one trains, how it predicts, and where it breaks.
🛠️ A builder of ML tools A tested pattern for truthful visualisation: immutable snapshots, checked predictions, no invented frames.

🔍 Opening the black box

A trained model is usually a black box: numbers go in, a prediction comes out, and you are asked to trust it. These videos open the box. They draw the model's own internals, read straight from the fitted estimator (coef_, tree_, estimators_, support_vectors_, theta_ and var_, coefs_), not an after-the-fact approximation such as a surrogate model or a feature-attribution estimate. That is what makes every explanation checkable: the worked equation is the model's real computation, so it has to land on predict's exact answer before it prints ✓.

Model 🗃️ What is inside the box 🔎 Why it gave this answer
📏 Linear, Ridge, Lasso, SGD every weight, drawn as an edge whose width and colour follow it; Lasso's zeroed features go dashed each feature's push w·x, summed with the bias into the price
📈 Logistic regression, perceptron, linear SVM the same weighted sum, plus the S-curve or the ±1 margin the score z, its side of the threshold, and σ(z) where it is a real probability
🌳 Decision tree every split, with its threshold in real units ("age ≤ 12.5?"), nodes coloured by their examples' average price or survival share the exact path of yes/no questions, and the training examples that share its leaf
🌲 Random forest the individual trees, not just their average every tree's vote, and the average the forest returns
🚀 Gradient boosting each tree's correction, shrinking as the errors shrink the running total from the base rate F₀, tree by tree, to the final answer
📍 k-nearest neighbours the stored training examples, which is all KNN keeps the k nearest examples and their prices or fates
🛡️ SVM (RBF kernel) which training passengers became support vectors, and how much each weighs (α) the strongest pulls α·y·K(xᵢ, x) and the margin f(x) they add up to
🔔 Naive Bayes the base rates and one bell curve per feature and outcome how strongly each feature's value favours "survived" over "did not" (its log-likelihood ratio)
🧠 Neural network (MLP) every weight, re-coloured each epoch as training moves it the forward pass: which hidden units fire and how much signal each edge carries

Seeing the box open teaches things a score never shows:

Honest limits:

👀 How well training and inference are visualised

Most "ML animations" are a loss curve and a confusion matrix. These videos show the algorithm itself working, synchronised with the numbers that prove it, at both stages of a model's life.

🏋️ At training time

🔮 At inference time

🎓 In the narrated lessons

Each lesson is a 108-second, 2560×1440, 30 fps story of one algorithm that works with the sound off, in ten chapters: title → data → first guess → training → final model → prediction on an unseen example → final exam → 3-D view → more features → takeaway.

🏆 Scoreboard

Test-set results from the live dashboards (all 8 features). The lessons use one or three features on purpose, so each picture tells one story; their scores are in each lessons folder's lessons_summary.csv.

🏠 Regressor Test RMSE Test R² 🚢 Classifier Test accuracy
🥇 Gradient Boosting $49.7k 0.812 🥇 Gradient Boosting 83.6%
🥈 Random Forest $50.9k 0.802 🥇 MLP (32-16) 83.6%
🥉 MLP (64-32) $53.2k 0.784 🥉 KNN (k=11) 82.8%
KNN (k=10) $64.1k 0.686 SVM (RBF) 82.4%
Decision Tree (depth 18) $69.6k 0.631 Random Forest 79.8%
Lasso $74.8k 0.573 Logistic Regression 79.4%
Linear Regression $75.0k 0.571 SGD (logistic) 77.1%
Ridge $75.0k 0.571 Naive Bayes 77.1%
SGD Regressor $77.3k 0.544 Decision Tree (depth 14) 74.0%

The decision trees are reported at the end of their depth sweeps, which over-fit on purpose: that is the lesson their videos teach.

🔒 Truthfulness rules

These are enforced by the test suites, not just promised:

🚀 Quick start

You need Python 3.10+ and ffmpeg on your PATH (brew install ffmpeg). Nothing is installed as a package: each project finds the kit next to it.

git clone https://github.com/di37/animated-machine-learning-algorithm.git
cd animated-machine-learning-algorithm

🏠 California Housing

cd house_price_animations
pip install -r requirements.txt
python animate.py --model gradient_boosting       # live window + training and inference videos
python animate.py --scene race                    # The Algorithm Race
python animate.py --scene map                     # Watch the model learn California
python animate_lessons.py --model decision_tree   # one narrated lesson

🚢 Titanic

cd titanic_animations
pip install -r requirements.txt
python animate_titanic.py --model random_forest
python animate_titanic.py --scene race
python animate_titanic.py --scene landscape       # Who survives?
python animate_titanic_lessons.py --model knn

🎞️ Manim lessons (set up manim_lesson_kit/.venv first; its README shows how)

cd house_price_manim_lessons
../manim_lesson_kit/.venv/bin/python animate_manim_lessons.py --model linear_regression

Every command takes --list and --help. Dashboards also accept --no-live (record only), --phase training|inference|both and --format gif.

⭐ If an algorithm finally clicked for you

Star the repository so more learners find it, and share a video with someone learning ML.

★ Star on GitHub

Open MP4 ↗