AI Grounds
Open AI Grounds on a desktop
These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.
AI Grounds
These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.
Guided discovery
Change graph scale; inspect map packing.
A small deterministic UMAP graph-objective demo on eight fixed 3D points. Map axes are arbitrary, not original feature units. Full-pair optimization differs from umap-learn’s production solver. This plot auto-fits with equal axis scales. These are initial coordinates, before optimization.
Dashed spokes show source union connections on current map positions. Thickness is 1+3×weight; spoke length is map distance, not original distance. Choose Inspect point to locate any ID. Only its label is shown; every exact row remains at overlaps. Points are not draggable.
Count other IDs used in each source neighborhood; changing it restarts at 0. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.
Shape the soft map-membership curve at fixed spread 1; this is not a hard distance bound. Changing it restarts at 0. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.
Inspect actual fifty-step checkpoints; a finite run is not a certified global optimum. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.
Two groups · Neighbors 3 · Min distance 0.2 · Iterations 0 · Inspect P1 · Components 2 · Loss 19.979075
Inspect P1: rho = 1.529706; sigma = 1.103985. Directed u = exp(−max(0,d−rho)/sigma) for selected neighbors; source union w = u+v−uv. Map q = 1/[1+a×(distance²+10⁻¹²)ᵇ], a = 1.262058, b = 1.003005.
Rho is the nearest positive source distance; sigma sets local distance scale. Membership means edge strength between 0 and 1. Directed rows sum log₂(Neighbors), not 1. Source union weights and map memberships are not normalized probability rows or global joint distributions. Self is excluded. A graph component is a group linked by paths, not a proved semantic class.
| Case | Original (F1,F2,F3) | Map (X,Y) | Source distance | u(P1→j) | u(j→P1) | w1j | q1j |
|---|---|---|---|---|---|---|---|
| P1 (self) | (-3.000000, -2.000000, 0.000000) | (-0.800000, -0.200000) | 0.000000 | 0.000000 | 0.000000 | 0.000000 | 0.000000 |
| P2 | (-2.200000, -3.100000, 0.700000) | (0.100000, 0.700000) | 1.529706 | 1.000000 | 1.000000 | 1.000000 | 0.328138 |
| P3 | (-3.400000, -3.600000, 1.900000) | (0.600000, -0.500000) | 2.515949 | 0.409283 | 0.363126 | 0.623787 | 0.278334 |
| P4 | (-1.500000, -1.800000, 3.100000) | (-0.400000, 0.600000) | 3.449638 | 0.175680 | 0.003768 | 0.178786 | 0.497768 |
| P5 | (2.000000, 2.000000, 0.000000) | (0.800000, 0.200000) | 6.403124 | 0.000000 | 0.000000 | 0.000000 | 0.225066 |
| P6 | (3.300000, 2.400000, 0.800000) | (-0.100000, -0.700000) | 7.725930 | 0.000000 | 0.000000 | 0.000000 | 0.517310 |
| P7 | (1.700000, 3.500000, 1.800000) | (-0.600000, 0.500000) | 7.455200 | 0.000000 | 0.000000 | 0.000000 | 0.599659 |
| P8 | (3.100000, 3.200000, 3.300000) | (0.400000, -0.600000) | 8.668333 | 0.000000 | 0.000000 | 0.000000 | 0.330891 |
Directed row sum 1.584963 = log₂(3); 12 positive union edges; 2 connected components. Source-weighted mean map-edge distance 1.182331 = Σi<j wᵢⱼ×map distance / Σi<j wᵢⱼ. This describes packing for a fixed graph; it is not task quality.
Groups linked by positive union edges.
2
12 edges among 28 possible pairs
Graph connectivity is not true semantic class count.
Bernoulli graph-fit divergence, in nats.
19.979075
Σi<j [w ln(w/q)+(1−w) ln((1−w)/(1−q))]
Compare fitting for fixed graph/curve; not accuracy.
Smallest distance among the 28 map pairs.
0.223607
min i<j ||yᵢ−yⱼ||
Min distance shapes a curve; no hard lower bound.
Eight fixed three-feature vectors use equal Euclidean weights without standardization. This demo follows the paper’s k-other-neighbors convention. Exact ranks use distance then ID for ties; local connectivity uses the nearest positive distance and sigma is searched to match log₂(k). It does not reproduce umap-learn’s self-containing neighbor-array convention or every supported data case. Union w=u+v−uv is symmetric with no extra normalization.
At fixed spread 1, five supported Min distance settings use precomputed a/b coefficients from the official nonlinear least-squares convention: 300 samples on [0,3] fit a smooth 1/(1+a×distance²ᵇ) curve to an offset exponential. The optimizer uses distance²+10⁻¹² for finite zero-distance evaluation. Min distance is not a hard constraint; it shapes the curve.
The loss sums Bernoulli divergence over all 28 unordered nonself pairs, in nats. Terms with zero weight contribute zero by continuity. The source entropy term is retained, so this differs from cross-entropy-only reports by a graph-dependent constant. The gradient is 2bΣj(w−q)(yᵢ−yⱼ)/(distance²+10⁻¹²). Each deterministic step tries rate 1 with up to 24 halvings, accepts nonincrease and recenters; if no trial is accepted the map stays fixed. All 200 frames use one fixed initial coordinate array.
This is full-pair fitting of the UMAP graph objective, without approximate-neighbor search, spectral initialization, stochastic edge sampling or negative sampling. It is a small teaching demo, not umap-learn output or performance parity. Finite maps do not certify a global optimum, original global distances, semantic clusters or downstream quality. The plot auto-fits and preserves equal scales; every exact coordinate stays in the table.
Scenario/Neighbors/Min distance edits restart optimization at 0 and clear stale answers; checkpoint edits also clear them. Inspect point only changes evidence and preserves mastery. Prediction/Reset restores the current baseline; free-exploration Reset starts Experiment 1. Uniform scaling changes original units and local scales together; nonuniform feature scaling can change neighborhoods. No transforms, inverse reconstruction, arbitrary uploads, automatic best settings or production benchmarks are included.
McInnes, Healy & Melville · Original UMAP paper