adaptyv
How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user…
Use UMAP-learn for nonlinear dimensionality reduction, 2D/3D embeddings, clustering preprocessing, supervised or semi-supervised UMAP, DensMAP, AlignedUMAP, and Parametric UMAP workflows.
$ npx -y skills add K-Dense-AI/scientific-agent-skills --skill umap-learn --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/umap-learnContext preview
The summary Claude sees to decide when to auto-load this skill.
Use UMAP-learn for nonlinear dimensionality reduction, 2D/3D embeddings, clustering preprocessing, supervised or semi-supervised UMAP, DensMAP, AlignedUMAP, and Parametric UMAP workflows.
name: umap-learn description: Use UMAP-learn for nonlinear dimensionality reduction, 2D/3D embeddings, clustering preprocessing, supervised or semi-supervised UMAP, DensMAP, AlignedUMAP, and Parametric UMAP workflows. license: BSD-3-Clause license metadata: version: "1.3" skill-author: K-Dense Inc.
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.
Current stable release: **umap-learn 0.5.12** (released 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
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
**Preprocessing requirement:** Match preprocessing to the metric. For numeric Euclidean-style metrics, scale features before fitting so high-variance columns do not dominate. For cosine, binary, precomputed-distance, or mixed-feature workflows, choose preprocessing that matches the metric instead of blindly standardizing every column.
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()UMAP has four primary parameters that control the embedding behavior. Understanding these is crucial for effective usage.
**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:**
**Recommendation:** Start with 15 and adjust based on results. Increase for more global structure, decrease for more local detail.
**Purpose:** Controls how tightly points cluster in the low-dimensional space.
**How it works:** Sets the minimum distance apart that points are allowed to be in the output representation.
**Effects by value:**
**Recommendation:** Use 0.0 for clustering applications, 0.1-0.3 for visualization, 0.5+ for loose structure.
**Purpose:** Determines the dimensionality of the embedded output space.
**Key feature:** Unlike t-SNE, UMAP scales well in the embedding dimension, enabling use beyond visualization.
**Common uses:**
**Recommendation:** Use 2 for visualization, 5-10 for clustering, higher for ML pipelines.
**Purpose:** Specifies how distance is calculated between input data points.
**Supported metrics:**
**Recommendation:** Use euclidean for numeric data, cosine for text/document vectors, hamming for binary data.
# For visualization with emphasis on local structure umap.UMAP(n_neighbors=15, min_dist=0.1, n_components=2, metric='euclidean') # For clustering preprocessing umap.UMAP(n_neighbors=30, min_dist=0.0, n_components=10, metric='euclidean') # For document embeddings umap.UMAP(n_neighbors=15, min_dist=0.1, n_components=2, metric='cosine') # For preserving global structure umap.UMAP(n_neighbors=100, min_dist=0.5, n_components=2, metric='euclidean')
UMAP supports incorporating label information to guide the embedding process, enabling class separation while preserving internal structure.
Pass target labels via the `y` parameter when fitting:
# Supervised dimension reduction embedding = umap.UMAP().fit_transform(data, y=labels)
**Key benefits:**
#
🔔 Claude Scientific Skills is now Scientific Agent Skills. Same skills, broader compatibility — now works with any AI agent that supports the open Agent Skills standard, not just Claude.
How to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user…
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection,…
Plan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP…
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data…
Autonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree…
Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk…