umap-learn
Lets your agent reduce data complexity for visualization. It's useful for understanding patterns in large datasets, making analysis easier.
What it does
UMAP-learn is a tool that simplifies complex data, making it easier to visualize or use in other analyses. It helps find hidden patterns in data with many features.
When to use it
- ✓To create plots showing the structure of your data.
- ✓To prepare data for clustering algorithms.
- ✓To reduce the number of features in your data before using it in machine learning models.
Example of what to ask your AI
“Transform these customer data into a 2D visualization so I can see how they cluster.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
UMAP-learn analyzes the neighborhood relationships between data points and rearranges them into a lower-dimensional space, trying to preserve these relationships as much as possible.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add K-Dense-AI/scientific-agent-skills --skill umap-learnOr download just the file:
curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/umap-learn/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
UMAP-Learn
Overview
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 approximate neighborhood structure, supervised learning, and clustering preprocessing.
Before interpreting an embedding, check finite coordinates, neighborhood retention, sensitivity to seeds/parameters, and domain evidence in the original space. UMAP axes, island areas, and gaps between clusters have no calibrated physical or probabilistic meaning. Keep predictive test data outside preprocessing and embedding fits.
Quick Start
Installation
Verified on 2026-10-01: umap-learn 0.5.12 is the current stable release (April 2026). Requires Python 3.9+ and depends on scikit-learn>=1.6, numba, pynndescent, numpy, and scipy. Pin to a verified release:
uv pip install umap-learn==0.5.12
Basic Usage
UMAP uses the scikit-learn estimator interface, but its geometry and supervised behavior differ from PCA and t-SNE. Core examples were exercised on small synthetic data with Python 3.13, scikit-learn 1.9.1, NumPy 2.5.3, and Numba 0.68.0. Parametric examples are source-checked illustrations, not executed TensorFlow tests. In snippets below, data is a finite samples-by-features array and labels must follow the same row order.
import umap
from sklearn.preprocessing import StandardScaler
# Scale continuous features when their units should carry equal weight
scaled_data = StandardScaler().fit_transform(data)
# Method 1: Single step (fit and transform)
embedding = umap.UMAP(random_state=42, n_jobs=1).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
Preprocessing requirement: Match preprocessing to the metric. For numeric Euclidean-style metrics, decide whether scaling is scientifically appropriate; it changes the feature weighting. Fit preprocessing on training data only for predictive work. Use StandardScaler(with_mean=False) for sparse matrices to avoid densifying them. For cosine, binary, precomputed-distance, or mixed-feature workflows, choose preprocessing that matches the metric instead of blindly standardizing every column.
Typical Workflow
import umap
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
# 1. Preprocess data
scaler = StandardScaler()
scaled_data = scaler.fit_transform(raw_data)
# 2. Create and fit UMAP
reducer = umap.UMAP(
n_neighbors=15,
min_dist=0.1,
n_components=2,
metric='euclidean',
random_state=42
)
embedding = reducer.fit_transform(scaled_data)
# 3. Visualize
plt.scatter(embedding[:, 0], embedding[:, 1], c=labels, cmap='Spectral', s=5)
plt.colorbar()
plt.title('UMAP Embedding')
plt.show()
Parameter Tuning Guide
UMAP has four primary parameters that control the embedding behavior. Understanding these is crucial for effective usage.
n_neighbors (default: 15)
Purpose: Balances local versus global structure in the embedding.
How it works: Controls the size of the local neighborhood UMAP examines when learning manifold structure.
Effects by value:
- Low values (2-5): Emphasizes fine local detail but may fragment data into disconnected components
- Medium values (15-20): Balanced view of both local structure and global relationships (recommended starting point)
- High values (50-200): Prioritizes broad topological structure at the expense of fine-grained details
Recommendation: Start with 15, keep it below the number of fitted samples, and compare several values. Larger neighborhoods do not make inter-cluster distances quantitatively reliable.
min_dist (default: 0.1)
Purpose: Controls how tightly points cluster in the low-dimensional space.
How it works: Adjusts the attraction curve and typical packing in the embedding; it is not a hard lower bound on pairwise distances. Require 0 <= min_dist <= spread.
Effects by value:
- Low values (0.0-0.1): Creates clumped embeddings useful for clustering; reveals fine topological details
- High values (0.5-0.99): Encourages looser packing; does not certify preservation of global distances
…
FAQ
What are the main settings I can adjust?
You can adjust 'n_neighbors' (how many neighbors to consider), 'min_dist' (how close points can be), and 'n_components' (the final dimension of the output).
Do I need to preprocess my data?
Yes, it's often good to 'scale' your data (make all features have equal weight) before using UMAP, especially if features have different units.
What do the axes of the resulting plot mean?
The axes of the plot generated by UMAP do not have a direct physical or probabilistic meaning. They are solely for visualizing the found structure.
Details
Original description by the author
Applies UMAP-learn to nonlinear dimensionality reduction, 2D/3D embeddings, clustering preprocessing, supervised or semi-supervised UMAP, DensMAP, AlignedUMAP, and Parametric UMAP workflows.
Popularity
- GitHub stars
- 51k
- Ranking position
- #1996
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
13c-metabolic-flux
Estimates metabolic fluxes using carbon-13 isotope tracing data. It is useful for analyzing cellular metabolism and biochemical pathways.
K-Dense-AI/scientific-agent-skills
adaptyv
Designs protein characterization experiments using the Adaptyv API. It helps estimate costs, submit sequences, and monitor lab results.
K-Dense-AI/scientific-agent-skills
aeon
Performs machine learning tasks on time series data. It is useful for classifying, forecasting, detecting anomalies, and finding patterns in sequential data.
K-Dense-AI/scientific-agent-skills
alphagenome
Looks up precomputed genomic effects for genetic variants. It provides scores and explanations to understand the impact of variants on the genome.
K-Dense-AI/scientific-agent-skills
Similar skills
pytorch-patterns
Helps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
affaan-m/ECC
evm-token-decimals
Helps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
affaan-m/ECC
knowledge-agent
Creates and queries knowledge bases using AI. It allows asking questions about past work or compiling expertise on a topic.
thedotmack/claude-mem