Machine Learning, Visualised
Classifiers, regressors, clustering and the evaluation metrics that tell you whether any of it worked.
About this track
A machine learning model is easier to trust once you have watched it get things wrong. Every module in this track puts the model on screen with the controls that drive it, so you can push it into failure on purpose: set k to 1 and watch KNN overfit, unbalance the classes and watch accuracy stay high while the model becomes useless.
The track runs from splitting data through the classical algorithms - linear regression, KNN, decision trees, naive Bayes, SVM, k-means - and ends on the evaluation and drift questions you hit once a model is real.
Nothing here requires a library. Each model is implemented in the page itself and run in front of you, so the numbers in the readout are computed by the same code that draws the picture rather than quoted from somewhere else.
What you will be able to do
- Choose between regression, classification and clustering for a given problem.
- Explain what a decision boundary is and why some models can only draw a straight one.
- Read a confusion matrix and pick the metric that matches what the errors actually cost.
- Recognise overfitting from a train/validation gap rather than from a single score.
- Split data so that the number you report survives contact with new data.
How the track is ordered
The track opens with the two things that come before any model: how to split data, and how to tell whether a result means anything. Then it works through the classical algorithms roughly in order of how much machinery they need - linear and logistic regression, KNN, naive Bayes, decision trees, random forests, SVM - and finishes on unsupervised methods and the evaluation metrics that apply across all of them. It assumes you are comfortable with a graph and an equation; the maths track covers anything heavier.
Where this leads
Logistic regression is a single neuron, so the deep learning track continues directly from here. If the modelling is clear but the data handling is not, the databases track covers where the data comes from, and the algorithms track covers the complexity arguments that decide whether a method scales.
All 45 modules, in teaching order
- 01Train-Test Split MethodSee why testing on data you trained on flatters a model, and how holding out a test set gives you an honest score.
- 02Feature Scaling
- 03Data Leakage
- 04Handling Missing Values
- 05Outliers and Influence
- 06Pipelines
- 07Label Encoding ProcessTurn categories into integers, and see where label encoding is safe and where it invents an ordering your model will believe.
- 08One-Hot EncodingExpand a categorical column into binary columns and see how one-hot encoding avoids implying an order that was never there.
- 09Linear Regression with OLSDrag a regression line by hand and watch the residuals and mean squared error react, then let least squares find the optimum.
- 10Evaluation Metrics for RegressionCompare MAE, MSE, RMSE and R-squared on identical predictions and see which kinds of error each metric punishes hardest.
- 11Logistic RegressionFit a linear score, squash it through a sigmoid, and read the probability anywhere on the plot. See why the boundary is always a straight line.
- 12K-Nearest NeighborsDrop a new point on the plane and watch KNN classify it by neighbour vote. Change k to see the decision boundary tighten or smooth.
- 13Confusion Matrix AnalysisSee why accuracy alone misleads. Build a confusion matrix cell by cell and watch precision, recall and F1 shift with every prediction.
- 14Precision, Recall and F1
- 15ROC Curve and AUCDrag a threshold through two overlapping score distributions and watch the ROC curve, AUC and precision respond - including the imbalance trap.
- 16Precision-Recall against ROC
- 17Threshold Tuning
- 18Decision Tree AnalysisWatch a decision tree choose each split by information gain, growing branch by branch until every leaf holds a single class.
- 19Random Forest and BaggingGrow one deep tree, then forty, and watch a jagged unstable boundary average into a smooth one. Bagging and feature subsampling, measured.
- 20Gradient BoostingAdd one small tree at a time, each fitted to the residuals left by the last. Watch the errors shrink, and watch it overfit when the trees get too deep.
- 21Naive Bayes ClassifierStep through Bayes' theorem on real text and see why a 'naive' independence assumption still classifies spam remarkably well.
- 22Support Vector MachinesAdd points from two classes and watch a support vector machine find the hyperplane with the widest possible margin between them.
- 23K-Means ClusteringPlace centroids and watch K-Means alternate between assigning points and recentring clusters until it converges.
- 24Principal Component AnalysisRotate a line through a point cloud and watch the variance it captures peak on exactly one angle. That angle is PC1, and the rest is what you lose.
- 25Cosine Similarity MetricMeasure similarity by angle instead of distance. Drag two vectors apart and watch the cosine similarity score respond in real time.
- 26K-Fold Cross ValidationWatch data split into k folds, each taking a turn as validation, and see why a single train/test split can flatter a model.
- 27Bias vs VarianceDial bias and variance up and down, resample the data, and watch a stable underfit turn into an unstable overfit.
- 28Learning Curves
- 29DBSCAN: Density-Based Clustering
- 30Hierarchical Clustering and Dendrograms
- 31Choosing k: Elbow and Silhouette
- 32Gaussian Mixture Models
- 33t-SNE and UMAP beside PCA
- 34Feature and Permutation Importance
- 35Partial Dependence, ICE and SHAP
- 36Probability Calibration
- 37Isolation Forest
- 38Stacking and Voting Ensembles
- 39Grid Search against Random Search
- 40Ridge and Lasso RegressionTurn lambda up and watch a wild polynomial calm down. Ridge shrinks every coefficient; Lasso drives the useless ones to exactly zero.
- 41Label Imbalance ProblemSee how a model scores 99% accuracy while missing every fraud case, and why imbalance breaks your intuition about metrics.
- 42Training on Imbalanced DatasetTry resampling, class weights and threshold tuning on an imbalanced dataset and watch minority-class recall respond.
- 43Hard vs Soft LabellingCompare a single hard label against a probability distribution, and see what a model loses when forced to pick one winner.
- 44Sliding Window for Time SeriesSlide a window across a time series to turn a raw sequence into supervised training rows of features and targets.
- 45Model and Data DriftFast-forward through production and watch a well-trained model decay as incoming data drifts away from what it learned.