Interactive ML Demos

📚 Prerequisites

🎯 What You’ll Explore

  • Fit a linear regression line by clicking to add data points
  • Watch K-Means clustering step-by-step
  • Visualise gradient descent converging on a loss surface

Demo 1: Linear Regression Visualiser

Click on the canvas to add data points. The best-fit line is computed in real-time using the least squares formula. The MSE is displayed below.

Equation: y = 0

MSE: 0  |  R²: 0  |  Points: 0

Demo 2: K-Means Clustering

Click to place data points, then press “Run K-Means” to watch the algorithm iterate step-by-step. Centroids are shown as larger squares.

Iteration: 0  |  Status: Click to add points

Demo 3: Gradient Descent Visualiser

Watch gradient descent minimise f(w) = w² − 4w + 5 starting from different initial points. Adjust the learning rate to see convergence behaviour.

w = -2  |  f(w) = 17  |  f'(w) = -8  |  Step: 0