ds-utils-unsupervised

Visualize clustering results to evaluate cluster cardinality and magnitude.

37|7|Updated Jun 24, 2018
One-click install
npx skills add https://github.com/idanmoradarthas/DataScienceUtils --skill ds-utils-unsupervised
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ds-utils-unsupervised
Source: https://github.com/idanmoradarthas/DataScienceUtils/tree/main/skills/unsupervised
Command: npx skills add https://github.com/idanmoradarthas/DataScienceUtils --skill ds-utils-unsupervised

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides practical tools to analyze unlabeled data by visualizing clustering results, enabling data scientists to interpret structure without supervision.

Core Features & Use Cases

  • Plot cluster cardinality: Visualizes the number of points in each cluster to assess balance and detect anomalies.
  • Plot cluster magnitude: Shows total distance from points to their cluster centers to gauge cluster compactness.
  • Plot magnitude vs cardinality: Detects anomalous clusters by comparing magnitude to cardinality.
  • Plot loss vs cluster number: Assists in selecting the optimal k by evaluating within-cluster loss across k values.

Quick Start

Run plot_cluster_cardinality on your fitted labels to visualize cluster sizes and use plot_loss_vs_cluster_number to identify the optimal number of clusters.

Frequently Asked Questions about ds-utils-unsupervised

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the optimal number of clusters for k-means?

Visualize cluster cardinality to see the number of data points assigned to each cluster, which helps assess cluster balance and detect anomalies. This Skill generates plots from fitted labels to reveal cluster size distributions.

What is cluster magnitude and how does it relate to cardinality?

Yes, this Skill works with any scikit-learn-compatible clustering model. You need Python with scikit-learn and matplotlib installed, and you must provide feature matrices, fitted labels, and cluster centers as inputs.

How do I detect anomalous clusters in unlabeled data?

Detect anomalous clusters by comparing cluster magnitude against cardinality. Clusters with unexpected magnitude-to-cardinality ratios indicate outliers or poorly grouped data points in your unsupervised clustering results.

Why does my k-means clustering produce uneven cluster sizes?

Uneven cluster sizes are revealed by plotting cluster cardinality. This visualization shows the exact point distribution per cluster, helping you identify whether imbalances indicate natural data structure or algorithmic issues.