UMAP Layout Optimizer: Attractive & Repulsive Forces (2D)

UMAP reduces high-dimensional data to a handful of dimensions by optimizing a low-dimensional layout so that its k-nearest-neighbor graph structure is preserved — using an attractive force along graph edges and a sampled inverse-square repulsive force between non-neighbor pairs, exactly the two-force tug-of-war visualized here in real time on a flat 2D canvas. Four synthetic clusters, generated in a real 6-dimensional space, start as random noise and are pulled and pushed into shape epoch by epoch; tune n_neighbors, min_dist, repulsion strength and optimizer speed while live readouts track layout stress and how much of the original 6D neighbor structure survives the 2D embedding.