Aligned UMAP and Model Composition
Use this sub-skill when embeddings must stay comparable across related slices,
time periods, batches, or feature views, or when a task asks to combine fitted
UMAP models with *, +, or -.
Route Here For
umap.AlignedUMAPon a list of related datasets.- Relation dictionaries that map sample indices from one slice to the next.
- Online updates with a new slice and relation map.
- Per-slice parameter lists for
n_neighborsor other AlignedUMAP parameters. - Choosing
alignment_regularisationoralignment_window_size. - Combining two fitted
UMAPmodels over the same samples using intersection
(*), union (+), or contrast (-).
Route Elsewhere
- Single-dataset fit/transform/sparse/precomputed workflows: read
- Supervised labels or densMAP: read
- Plotting aligned embeddings: read
- Parametric neural embeddings are out of scope for this sub-skill.
Quick AlignedUMAP Pattern
import umap
# X_slices is a list such as [X_t0, X_t1, X_t2].
# relations[t] must map row indices in X_slices[t] to row indices in
# X_slices[t + 1]. Keep those row positions stable after filtering/sorting.
relations = [
{0: 0, 1: 2, 2: 3},
{0: 1, 2: 2, 3: 4},
]
model = umap.AlignedUMAP(
n_neighbors=15,
alignment_regularisation=0.01,
alignment_window_size=3,
random_state=42,
).fit(X_slices, relations=relations)
embeddings = model.embeddings_