UMAP — a neighbor graph laid out in fewer dimensions
UMAP builds a weighted graph of nearest neighbors and then lays that graph out in the target dimension. Local neighborhoods are preserved more faithfully than far-away distances, but the global arrangement is less arbitrary than a t-SNE map: similar runs put the same groups in similar places. It also accepts a target dimension above 3, so it can be a preprocessing step and not only a picture.
n_neighbors is the local scale. Small values (5–15) trace fine groups and can shatter a continuous gradient into islands. Larger values (30–100) keep gradients and big separations. min_dist is how tightly a neighborhood packs in the layout. It changes the picture more than it changes a downstream classifier.
The axes of a UMAP layout are not principal components. You cannot describe axis 1 as a named column. If you need a sentence of the form "this direction is mostly petal length," use PCA.
Settings that change this fit
- n neighbors
- How much local structure is kept. Low values follow tiny groups. High values follow the broad shape of the cloud.
- min dist
- Packing of neighbors in the layout. Near 0, groups look like tight dots. Near 1, they spread out. The graph underneath is unchanged.