본문으로 건너뛰기
Skillpedia
머신러닝51k · #3588

umap-learn

하는 일

UMAP-learn은 복잡한 데이터를 단순하게 만들어 시각화하거나 다른 분석에 쓰기 쉽게 해 주는 도구입니다. 특성이 많은 데이터에 숨은 패턴을 찾는 데 도움을 줍니다.

사용하는 경우

  • ✓데이터의 구조를 보여 주는 그래프를 만들 때.
  • ✓군집 알고리즘에 쓸 데이터를 준비할 때.
  • ✓머신러닝 모델에 쓰기 전에 데이터의 특성 수를 줄이는 경우.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/umap-learn/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/umap-learn/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 고객 데이터를 2차원 시각화로 바꿔서 어떻게 군집을 이루는지 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

UMAP-learn은 데이터 점들 사이의 이웃 관계를 분석하고, 가능한 한 이 관계를 유지하면서 낮은 차원의 공간에 다시 배치합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

…

자주 묻는 질문

조정할 수 있는 주요 설정은 무엇인가요?

'n_neighbors'(고려할 이웃 수), 'min_dist'(점들이 얼마나 가까워질 수 있는지), 'n_components'(출력의 최종 차원)를 조정할 수 있습니다.

데이터를 전처리해야 하나요?

네, 특히 특성마다 단위가 다르다면 UMAP을 쓰기 전에 데이터를 '스케일링'(모든 특성의 비중을 같게 맞추기)하는 것이 좋습니다.

결과 그래프의 축은 무엇을 뜻하나요?

UMAP 그래프의 축은 직접적인 물리적 의미나 확률적 의미가 없습니다. 발견된 구조를 보여 주기 위한 용도로만 쓰입니다.

상세 정보

작성자의 원본 설명

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

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3588
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬