Clustering
K-means clustering, cluster evaluation, and predictive features
Clustering
Clustering groups observations without labels. This lecture covers k-means (iterative assignment and update), choosing the number of clusters with elbow plots and silhouette scores, and checking stability. We describe what the measured features support, then test whether centroid distances improve prediction.
Lecture materials
The 18-slide deck uses wine as a running example: choose k, check stability, compare the groups with known classes, then test centroid distances as predictive features.
- Run the wine example to reproduce the lecture results.
- Companion reference (Markdown): the diagnostic code and optional material on DBSCAN, Gaussian mixtures, MiniBatchKMeans, alternative distances and PCA visualisation.
Additional slides: Backpropagation and Gradient Descent
Gradient descent, then ADALINE and logistic regression as single neurons, followed by computational graphs, the chain rule and backpropagation through a small network. This separate deck explains how backpropagation computes gradients and how an optimiser uses them to update the parameters.
Open Backpropagation and Gradient Descent ↗
The notebook shown in the lecture builds a small automatic differentiation system from scratch: a Value class that records the computational graph, a backward pass that applies the chain rule, and a gradient descent loop on the two-parameter loss from the slides. It needs only Python, with no extra packages.