Unsupervised learning finds structure in data that has no labels: nobody tells the algorithm which point belongs to which group. This scene generates a cloud of unlabelled points in 3D "feature space" and runs the k-means algorithm live in front of you — each colored sphere is a data point, each larger glowing sphere is a cluster centroid.
K-means minimizes "inertia" — the total squared distance from points to their assigned centroid — but it always finds groups shaped like round blobs. Data with rings or crescents (like the "two moons" preset) will fool it every time, which is why real data scientists reach for density-based or spectral methods on trickier shapes.
A cloud of unlabelled 3D points gets grouped live by the k-means algorithm — watch centroids chase their assigned points, outliers get flagged as anomalies, and the whole cloud flatten onto a lower-dimensional plane.
K-means alternates an assignment step (color each point by its nearest centroid) and an update step (move each centroid to the mean of its points) until the groupings stop changing — the core loop behind most clustering algorithms.
Pick how many clusters to fit and which dataset shape to fit them to, then watch it converge automatically, or step through iterations by hand. Toggle anomaly highlighting and the PCA-style flattening to see two more unsupervised techniques.
K-means always carves space into round, convex regions, so it fails badly on shapes like the "two moons" preset — a classic illustration of why algorithm choice matters as much as the data itself.