Optimal Number of Clusters (Elbow, Silhouette, Gap)
Optimal number of clusters analysis compares k-means solutions over a range of k using the elbow of within-cluster inertia, average silhouette width, the Calinski–Harabasz index and the gap statistic.
최적 군집 수 결정은 여러 k 에 대한 k-평균 해를 엘보(군집 내 관성), 평균 실루엣, Calinski–Harabasz 지수, 갭 통계량으로 비교하는 절차입니다.
How many clusters should I choose for k-means, and do different criteria agree?
k-평균에서 군집을 몇 개로 해야 하는지, 여러 기준이 같은 답을 주는지 알고 싶어요.
Each candidate k is fitted with k-means and scored by within-cluster inertia (elbow), average silhouette width, the Calinski–Harabasz ratio and the gap statistic, which compares log inertia with that of uniform reference data. Each criterion recommends its own k, and agreement among them gives stronger support than any single rule.
When to use Optimal Number of Clusters (Elbow, Silhouette, Gap)
- You plan to run k-means and need to justify the number of clusters.
- You want several standard criteria reported side by side.
- Variables are continuous and clusters are expected to be roughly compact.
When to use something else
- Clusters are irregular or noisy; use HDBSCAN, which does not require k, instead.
- You want likelihood-based model selection; use a Gaussian mixture model with BIC instead.
Assumptions and requirements
- Continuous variables on comparable scales (standardized).
- Roughly compact, spherical clusters suited to k-means.
- Enough cases for the largest k considered.
What the analysis reports
- Inertia, silhouette, Calinski–Harabasz and gap values for each k
- Recommended k for each criterion
- Gap standard errors and 1-SE rule
- Majority recommendation across criteria
How to report it
K-means solutions for k = 2–10 were compared (N = [n]): the elbow suggested k = [value], the silhouette k = [value], the Calinski–Harabasz index k = [value], and the gap statistic k = [value].
Related methods
Run Optimal Number of Clusters (Elbow, Silhouette, Gap) on Quorant
- Data you need
- a table (CSV or Excel) with predictor (feature) columns
- Price
- 250 credits for one analysis up to 10,000 rows (complexity level 2); larger or wider data costs more. Optional methodologist review: 1200 credits.
- Checking
- Checked by property tests in every deployment
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.