
If you need to squash high-dimensional data down for visualization or clustering, this is the modern answer. It's faster than t-SNE and actually preserves both local and global structure, which matters when you're trying to understand what your data is doing. The supervised mode is legitimately useful for metric learning, and it scales to higher output dimensions without falling apart, so you can use it as preprocessing for HDBSCAN or other clustering algorithms. Just remember to standardize your features first or you'll get garbage. The parameter guide here is solid: bump n_neighbors to 30 and min_dist to 0.0 for clustering, keep defaults for quick visualization. It follows scikit-learn conventions, so it drops right into existing pipelines.
$ npx -y skills add davila7/claude-code-templates --skill umap-learn --agent claude-codeInstalls into .claude/skills of the current project.
UMAP (Uniform Manifold Approximation and Projection) is a dimensionality reduction technique for visualization and general non-linear dimensionality reduction. Apply this skill for fast, scalable embeddings that preserve local and global structure, supervised learning, and clustering preprocessing.
uv pip install umap-learn
UMAP follows scikit-learn conventions and can be used as a drop-in replacement for t-SNE or PCA.
import umap
from sklearn.preprocessing import StandardScaler
# Prepare data (standardization is essential)
scaled_data = StandardScaler().fit_transform(data)
# Method 1: Single step (fit and transform)
embedding = umap.UMAP().fit_transform(scaled_data)
# Method 2: Separate steps (for reusing trained model)
reducer = umap.UMAP(random_state=42)
reducer.fit(scaled_data)
embedding = reducer.embedding_ # Access the trained embedding
Critical preprocessing requirement: Always standardize features to comparable scales before applying UMAP to ensure equal weighting across dimensions.
Sponsors