计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
umap-learn【效率与协作】Use the umap-learn package for UMAP dimensionality reduction, supervised and density workflows, aligned embeddings, plotting, and ParametricUMAP.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when a task asks how to use umap-learn / umap for
Uniform Manifold Approximation and Projection: dimensionality reduction,
visualization embeddings, transform workflows, supervised UMAP, densMAP,
aligned embeddings, optional plotting, or optional ParametricUMAP.
pip install umap-learn
import umap
mapper = umap.UMAP()
Package facts:
umap-learn.umap.>=3.10 in package metadata.Optional extras:
pip install "umap-learn[plot]" # umap.plot helpers
pip install "umap-learn[parametric_umap]" # TensorFlow/Keras ParametricUMAP
pip install "umap-learn[tbb]" # optional CPU optimization
Run scripts/check_umap_environment.py to
inspect a target environment and optional extras:
python scripts/check_umap_environment.py --json
| Task | Read |
|---|---|
| Fit a standard UMAP embedding, tune base parameters, transform new rows, inverse transform, use sparse/precomputed inputs, or debug core API errors | core-embedding |
| Use supervised labels, semi-supervised targets, densMAP, density outputs, clustering interpretation, or outlier analysis | supervised-density |
| Align related slices/time periods, update aligned embeddings, or combine fitted UMAP models with intersection/union/contrast operators | aligned-composition |
Use umap.plot points/connectivity/diagnostic/interactive helpers or fix optional plotting dependency failures | plotting-diagnostics |
Use optional TensorFlow/Keras ParametricUMAP, neural encoders/decoders, reconstruction, save/load, callbacks, landmarks, or ONNX export | parametric-umap |
umap.UMAP(random_state=42) on a sample while debugging; remove
the seed later if speed matters more than reproducibility.n_neighbors for local/global neighbourhood balance and min_dist for
embedding compactness.fit/fit_transform on training data and transform on held-out data;
check precomputed-distance shape contracts before using metric="precomputed".fit(X, y) only when labels should influence the manifold; validate with
a downstream metric rather than only a visually separated plot.umap-learn. Visible hardware is
irrelevant unless a separate optional neural backend is installed and verified.import umap
print(umap.__version__)
print(umap.UMAP(n_neighbors=5, n_epochs=10, random_state=42))
For a runnable toy-data check, use the core sub-skill smoke script:
python sub-skills/core-embedding/scripts/umap_core_smoke.py --transform --json