Linear regression
Move the points and watch the least squares line follow. Then learn the same line by gradient descent and compare.
English interface, partly translated: navigation, lab, projects, series, about and contact are; the home page sections, the site search and the content itself (articles, tutorials, research) are still in French.
Assign, update, assign… Follow the centroids until convergence, and discover where K-Means goes wrong: bad start, stretched clusters, rings.
K-Means splits points into clusters by looking for centroids that minimise the inertia, the sum of squared distances from each point to its centroid:
Lloyd's algorithm alternates two steps, each of which can only lower :
It stops when the assignment no longer changes. Convergence is guaranteed, but to a local minimum: the result depends on the starting centroids.
Inertia always decreases as grows (it is zero for ): it cannot choose on its own. Look for the "elbow" of the inertia-versus- curve, or use the silhouette score.
Move the points and watch the least squares line follow. Then learn the same line by gradient descent and compare.
Slide a 3 × 3 kernel over an image: blur, sharpen, edge detection. Edit the weights and follow the computation of one pixel, term by term.
Decompose an image into LL, HL, LH and HH sub-bands over several levels, drop the small coefficients and measure what the reconstruction loses.