Clustering Lab

Load or generate 2D points, then run k-means++, DBSCAN, or hierarchical clustering with step-by-step animation.

About this tool

Compare three Euclidean clustering methods on the same two-dimensional data. Run starts calculation; Step advances one k-means iteration, Pause and Continue retain its state. Reset clears the assignment, keeping the points. Demo data generates seeded blobs using the optional settings.

k-Means uses seeded k-means++ initialization, then Lloyd updates. SSE is the sum of squared distances to assigned centers. Empty groups retain their previous center. This finds a local solution, not a guaranteed global optimum; it stops when assignments stabilize or after 200 iterations. DBSCAN joins density-connected points within ε; minimum points includes the point itself. Gray points are noise. Single-linkage cuts a minimum spanning tree into k groups; thin chains can connect apparently separate blobs. Equal-distance ties may yield different valid partitions.

Paste or open CSV, then select different X and Y columns. X/Y headers are preferred, otherwise the first two numeric columns are used. Decimal points and decimal commas (quoted or with a semicolon delimiter) are accepted. Invalid rows are counted and skipped. Limits: 2,000 data rows, 32 columns, 1 MiB, coordinates from −10⁹ to 10⁹. Data is not standardized: coordinate scales affect distances. A small example is (0,0), (0,1), (10,10), (10,11): k=2 separates the pairs.

The plot uses the same scale on both axes. Ctrl/Meta + wheel zooms; Ctrl/Meta + drag pans. Fit points restores the view. The table gives group sizes and centers (k-means) or descriptive means (other methods); colors repeat after eight groups. CSV exports every valid point with its current assignment: groups start at 1, noise is 0. During k-means this may be an intermediate result. This is a small-data analyzer, with no dendrogram or automatic choice of parameters.