umap-learn

Use UMAP-learn for nonlinear dimensionality reduction, 2D/3D embeddings, clustering preprocessing, supervised or semi-supervised UMAP, DensMAP, AlignedUMAP, and Parametric UMAP workflows.

Install

Hot:22

Download and extract to your skills directory

Copy command and send to AI Agent for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-skills-umap-learn&locale=en&source=copy

UMAP-Learn — Nonlinear Dimensionality Reduction and Manifold Learning Skills

Skill Overview


UMAP-Learn is a high-performance Python dimensionality reduction library for visualizing high-dimensional data, clustering preprocessing, and feature engineering. It supports supervised and semi-supervised learning, parametric models, and analyses of aligned datasets.

Use Cases


  • High-Dimensional Data Visualization: Maps complex feature spaces to 2D/3D visualization spaces to reveal intrinsic cluster structures and topological relationships, suitable for exploratory data analysis and pattern discovery.

  • Clustering Preprocessing Pipelines: As a precursor step for density-based clustering algorithms such as HDBSCAN, it helps overcome the “curse of dimensionality,” improving clustering results and the quality of data grouping.

  • Supervised and Semi-Supervised Feature Engineering: Uses label information to guide the dimensionality reduction process, producing more discriminative embedding features for downstream classification model training or semi-supervised learning scenarios.
  • Core Functions


  • Nonlinear Dimensionality Reduction and Embeddings: Provides efficient manifold learning algorithms, supporting multiple distance metrics such as Euclidean, cosine, and Hamming. Parameters like n_neighbors, min_dist, and n_components allow flexible control over the balance between local and global structure.

  • Supervised and Semi-Supervised Learning: Incorporates label information via the y parameter in fit_transform. Achieves separation between classes while preserving within-class structure, and supports semi-supervised scenarios with partial labels.

  • Parametric UMAP and New Data Transformation: Supports learning a parametric mapping function via neural networks, enabling efficient transformation and inverse-transform reconstruction of new data. Suitable for real-time production environments and deep learning workflows.
  • Common Questions

    What are the differences between UMAP and t-SNE?


    UMAP is generally better than t-SNE at preserving global structure, and it is also more computationally efficient with lower memory usage. t-SNE mainly focuses on local neighborhood relationships, whereas UMAP uses topological analysis to better balance local and global patterns. In addition, UMAP supports the transform method to map new data into an already learned embedding space, while t-SNE typically requires recomputation.

    How should I choose the n_neighbors and min_dist parameters?


  • n_neighbors controls the balance between local and global structure: smaller values (2–5) emphasize local details, while larger values (50–200) highlight global topology.

  • min_dist controls how tightly points are embedded: smaller values (0.0–0.1) are suitable for clustering applications, while larger values (0.5–0.99) emphasize structure preservation rather than tight clustering.
  • As a rule of thumb, for visualization you can start with n_neighbors=15 and min_dist=0.1; for clustering preprocessing, start with n_neighbors=30 and min_dist=0.0.

    What kind of data preprocessing does UMAP require?


    Preprocessing strategies should match the selected metric:
  • For numeric metrics like Euclidean distance, it’s recommended to standardize features with StandardScaler to prevent high-variance columns from dominating distance calculations.

  • For cosine, binary, or precomputed-distance metrics, choose a preprocessing method that matches the metric rather than blindly standardizing.
  • Also ensure the input data contains no NaN or inf values; if necessary, handle missing values.