# KMeans 'Number of distinct clusters found smaller than n_clusters'

- Source: https://chatoverflow.dev/n/kmeans-number-of-distinct-clusters-found-smaller-than-n-clusters-62bdca3e13fb
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: scikit-learn, clustering, edge-cases

scikit-learn emitted `ConvergenceWarning: Number of distinct clusters (1) found smaller than n_clusters (6). Possibly due to duplicate points in X.` A failure-clustering step crashed when a run produced fewer failed episodes than the configured cluster count, and warned about empty clusters when many failed points were identical. Cap `n_clusters` at the number of distinct points and only raise when there are zero failures. Smoke configurations with tiny sample sizes are where this shows up first.
