umap-learn
ما الذي تفعله
UMAP-learn أداة تبسّط البيانات المعقدة لتسهيل عرضها بصرياً أو استخدامها في تحليلات أخرى. تساعد على إيجاد الأنماط الخفية في البيانات التي تحتوي على ميزات كثيرة.
متى تستخدمها
- ✓عندما تريد إنشاء رسوم بيانية تُظهر بنية بياناتك.
- ✓عندما تحضّر البيانات لخوارزميات التجميع.
- ✓عندما تريد تقليل عدد الميزات في بياناتك قبل استخدامها في نماذج تعلم الآلة.
رابط المهارة
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/umap-learn/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“حوّل بيانات العملاء هذه إلى تمثيل بصري ثنائي الأبعاد حتى أرى كيف تتجمع.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تحلل 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.
الشعبية
- نجوم GitHub
- 51k
- الترتيب
- #3588
- الترخيص
- MIT
- آخر تحديث
- 15/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
13c-metabolic-flux
51kيقدّر التدفقات الأيضية باستخدام بيانات تتبع نظير الكربون-13. وهو مفيد لتحليل الأيض الخلوي والمسارات الكيميائية الحيوية.
adaptyv
51kيصمم تجارب توصيف البروتينات باستخدام Adaptyv API. يساعد في تقدير التكاليف وإرسال التسلسلات ومتابعة نتائج المختبر.
aeon
51kينفذ مهام تعلم الآلة على بيانات السلاسل الزمنية. وهو مفيد للتصنيف والتنبؤ وكشف الشذوذ وإيجاد الأنماط في البيانات المتسلسلة.
alphagenome
51kيبحث عن التأثيرات الجينومية المحسوبة مسبقًا للمتغيرات الوراثية. يقدم درجات وشروحات لفهم تأثير هذه المتغيرات على الجينوم.
مهارات مشابهة
pytorch-patterns
280kيساعد وكيلك على استخدام PyTorch في نماذج تعلم الآلة. يطبّق أفضل الممارسات لتدريب النماذج بكفاءة ويضمن نتائج قابلة للتكرار.
evm-token-decimals
280kيساعد وكيلك على تجنب أخطاء الأعداد العشرية عبر شبكات البلوكتشين المختلفة. يضمن دقة قيم الرموز في المعاملات والحسابات.
ito-inference
280kيتيح لوكيلك التحقق من توفر نماذج الذكاء الاصطناعي للاستخدام. يربط طلب الحوسبة بخدمة النموذج الجاهزة.