WCSS<T>

Models & Types · AiDotNet.Clustering.Evaluation

Within-Cluster Sum of Squares (WCSS) metric for evaluating cluster compactness.

Implements: IClusterMetric<T>

For Beginners

WCSS measures how “tight” your clusters are.

For each point:

  • Find the center of its cluster
  • Measure the distance squared
  • Add up all these distances

Lower WCSS = Better clustering (tighter clusters)

Also called “inertia” in scikit-learn.

How It Works

WCSS measures the total squared distance of each point to its cluster centroid. Lower values indicate more compact clusters.

WCSS = sum over all clusters k of sum over all points i in k of ||x_i - c_k||^2

Constructors

Constructor Summary
WCSS() Initializes a new WCSS instance.

Properties

Property Summary
string Name { get; }

Methods

Method Summary
Dictionary<int, T> ComputePerCluster(Matrix<T> data, Vector<T> labels) Computes WCSS per cluster.
double Compute(Matrix<T> data, Vector<T> labels)