How does cluster-centroid undersampling compress the majority class compared to random undersampling?

Last updated 15 November 2026

  • It runs k-means on the majority class with k equal to the target size, then keeps the centroids (voting='soft') or the real sample nearest each centroid (voting='hard').

  • Unlike random undersampling, every majority region gets a representative (rare sub-modes aren't lost), and results vary less across seeds.

  • Caveats: soft centroids are synthetic averages that shrink variance and suit categorical or sparse data poorly. Density information is also lost, and k-means is costly and scale-sensitive.

  • https://imbalanced-learn.org/stable/under_sampling.html
  • https://hersanyagci.medium.com/under-sampling-methods-for-imbalanced-data-clustercentroids-randomundersampler-nearmiss-eae0eadcc145
  • https://www.youtube.com/watch?v=odXE7WiO2GM
All Imbalanced Datasets interview questions