Clustering Algorithm Runner
Run clustering algorithms (K-means, DBSCAN, hierarchical) on datasets to discover natural groupings and structure in data.
Overview
This skill empowers Claude to perform clustering analysis on provided datasets. It allows for automated execution of various clustering algorithms, providing insights into data groupings and structures.
How It Works
- Analyzing the Context: Claude analyzes the user's request to determine the dataset, desired clustering algorithm (if specified), and any specific requirements.
- Generating Code: Claude generates Python code using appropriate ML libraries (e.g., scikit-learn) to perform the clustering task, including data loading, preprocessing, algorithm execution, and result visualization.
- Executing Clustering: The generated code is executed, and the clustering algorithm is applied to the dataset.
- Providing Results: Claude presents the results, including cluster assignments, performance metrics (e.g., silhouette score, Davies-Bouldin index), and visualizations (e.g., scatter plots with cluster labels).
When to Use This Skill
This skill activates when you need to:
- Identify distinct groups within a dataset.
- Perform a cluster analysis to understand data structure.
- Run K-means, DBSCAN, or hierarchical clustering on a given dataset.
Examples
Example 1: Customer Segmentation
User request: "Run clustering on this customer data to identify customer segments. The data is in customer_data.csv."
The skill will:
- Load the customer_data.csv dataset.
- Perform K-means clustering to identify distinct customer segments based on their attributes.
- Provide a visualization of the customer segments and their characteristics.
Example 2: Anomaly Detection
User request: "Perform DBSCAN clustering on this network traffic data to identify anomalies. The data is available at network_traffic.txt."
The skill will:
- Load the network_traffic.txt dataset.
- Perform DBSCAN clustering to identify outliers representing anomalous network traffic.
- Report the identified anomalies and their characteristics.
Best Practices
- Data Preprocessing: Always preprocess the data (e.g., scaling, normalization) before applying clustering algorithms to improve performance and accuracy.
- Algorithm Selection: Choose the appropriate clustering algorithm based on the data characteristics and the desired outcome. K-means is suitable for spherical clusters, while DBSCAN is better for non-spherical clusters and anomaly detection.
- Parameter Tuning: Tune the parameters of the clustering algorithm (e.g., number of clusters in K-means, epsilon and min_samples in DBSCAN) to optimize the results.
Integration
This skill can be integrated with data loading skills to retrieve datasets from various sources. It can also be combined with visualization skills to generate insightful visualizations of the clustering results.
Prerequisites
- Appropriate file access permissions
- Required dependencies installed
Instructions
- Invoke this skill when the trigger conditions are met
- Provide necessary context and parameters
- Review the generated output
- Apply modifications as needed
Output
The skill produces structured output relevant to the task.
Error Handling
- Invalid input: Prompts for correction
- Missing dependencies: Lists required components
- Permission errors: Suggests remediation steps
Resources
- Project documentation
- Related skills and commands
1---
2name: running-clustering-algorithms
3description: |
4 Analyze datasets by running clustering algorithms (K-means, DBSCAN, hierarchical) to identify data groups. Use when requesting "run clustering", "cluster analysis", or "group data points". Trigger with relevant phrases based on skill purpose.
5allowed-tools: Read, Write, Edit, Grep, Glob, Bash(cmd:*)
6version: 1.0.0
7author: Jeremy Longshore <jeremy@intentsolutions.io>
8license: MIT
9compatible-with: claude-code, codex, openclaw
10metadata:
11 source: https://skillmd.com/skills/micsapp/running-clustering-algorithms
12---
13
14# Clustering Algorithm Runner
15
16Run clustering algorithms (K-means, DBSCAN, hierarchical) on datasets to discover natural groupings and structure in data.
17
18## Overview
19
20This skill empowers Claude to perform clustering analysis on provided datasets. It allows for automated execution of various clustering algorithms, providing insights into data groupings and structures.
21
22## How It Works
23
241. **Analyzing the Context**: Claude analyzes the user's request to determine the dataset, desired clustering algorithm (if specified), and any specific requirements.
252. **Generating Code**: Claude generates Python code using appropriate ML libraries (e.g., scikit-learn) to perform the clustering task, including data loading, preprocessing, algorithm execution, and result visualization.
263. **Executing Clustering**: The generated code is executed, and the clustering algorithm is applied to the dataset.
274. **Providing Results**: Claude presents the results, including cluster assignments, performance metrics (e.g., silhouette score, Davies-Bouldin index), and visualizations (e.g., scatter plots with cluster labels).
28
29## When to Use This Skill
30
31This skill activates when you need to:
32- Identify distinct groups within a dataset.
33- Perform a cluster analysis to understand data structure.
34- Run K-means, DBSCAN, or hierarchical clustering on a given dataset.
35
36## Examples
37
38### Example 1: Customer Segmentation
39
40User request: "Run clustering on this customer data to identify customer segments. The data is in customer_data.csv."
41
42The skill will:
431. Load the customer_data.csv dataset.
442. Perform K-means clustering to identify distinct customer segments based on their attributes.
453. Provide a visualization of the customer segments and their characteristics.
46
47### Example 2: Anomaly Detection
48
49User request: "Perform DBSCAN clustering on this network traffic data to identify anomalies. The data is available at network_traffic.txt."
50
51The skill will:
521. Load the network_traffic.txt dataset.
532. Perform DBSCAN clustering to identify outliers representing anomalous network traffic.
543. Report the identified anomalies and their characteristics.
55
56## Best Practices
57
58- **Data Preprocessing**: Always preprocess the data (e.g., scaling, normalization) before applying clustering algorithms to improve performance and accuracy.
59- **Algorithm Selection**: Choose the appropriate clustering algorithm based on the data characteristics and the desired outcome. K-means is suitable for spherical clusters, while DBSCAN is better for non-spherical clusters and anomaly detection.
60- **Parameter Tuning**: Tune the parameters of the clustering algorithm (e.g., number of clusters in K-means, epsilon and min_samples in DBSCAN) to optimize the results.
61
62## Integration
63
64This skill can be integrated with data loading skills to retrieve datasets from various sources. It can also be combined with visualization skills to generate insightful visualizations of the clustering results.
65
66## Prerequisites
67
68- Appropriate file access permissions
69- Required dependencies installed
70
71## Instructions
72
731. Invoke this skill when the trigger conditions are met
742. Provide necessary context and parameters
753. Review the generated output
764. Apply modifications as needed
77
78## Output
79
80The skill produces structured output relevant to the task.
81
82## Error Handling
83
84- Invalid input: Prompts for correction
85- Missing dependencies: Lists required components
86- Permission errors: Suggests remediation steps
87
88## Resources
89
90- Project documentation
91- Related skills and commands