AgentStack
SKILL verified MIT Self-run

Clustering

skill-ericwang915-data-scientist-skills-clustering · by ericwang915

Unsupervised clustering: K-Means, DBSCAN, hierarchical agglomerative, Gaussian Mixture Models, and spectral clustering. Includes optimal cluster count determination, validation metrics, and cluster profiling. Use when discovering natural groups in data.

No reviews yet
0 installs
12 views
0.0% view→install

Install

$ agentstack add skill-ericwang915-data-scientist-skills-clustering

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Clustering? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Clustering

Purpose

Discover natural groupings in data without predefined labels. Includes cluster validation and business-ready profiling.

How It Works

Step 1: Preprocessing

  • Standardize/normalize features (critical for distance-based methods)
  • Reduce dimensions if needed (PCA, UMAP for visualization)
  • Handle mixed data types (Gower distance, k-prototypes)

Step 2: Choose Algorithm

| Algorithm | Best For | Requires K? | |-----------|----------|-------------| | K-Means | Spherical clusters, large datasets | Yes | | DBSCAN | Arbitrary shapes, noise handling | No (ε, minPts) | | Hierarchical | Small datasets, dendrogram visualization | Optional | | Gaussian Mixture | Elliptical clusters, soft assignments | Yes | | Spectral | Complex shapes, graph-based | Yes | | HDBSCAN | Variable density, robust | No |

Step 3: Determine Optimal Clusters

  • Elbow method: Within-cluster sum of squares
  • Silhouette score: Cluster separation quality (-1 to 1)
  • Gap statistic: Compare with reference distribution
  • Dendrogram: Visual hierarchy (hierarchical clustering)
  • BIC/AIC: Model-based selection (GMM)

Step 4: Validate & Profile

  • Silhouette analysis per cluster
  • Cluster stability (bootstrap resampling)
  • Profile each cluster: mean features, distinguishing characteristics
  • Business naming: assign descriptive labels

Usage Examples

"Segment our customers into groups based on purchase behavior,
engagement metrics, and demographics"
"Find natural groupings in this sensor data — I don't know
how many clusters there should be"

Output Format

  • Cluster Summary: Size, key characteristics per cluster
  • Validation Metrics: Silhouette, stability scores
  • Visualization: 2D/3D scatter with cluster colors, dendrogram
  • Profiles: Feature means/distributions per cluster with business labels
  • Python Code: sklearn implementation

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.