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

Quick Overview

Asks how cluster-centroid undersampling shrinks the majority class of an imbalanced dataset and how its result differs from random undersampling. Tests the k-means mechanics, what each method keeps from rare and dense regions, and the trade-offs of synthetic centroids.

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

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

You are training a binary classifier on a dataset where the majority class far outnumbers the minority class, and you plan to undersample the majority before training. How does cluster-centroid undersampling compress the majority class compared to random undersampling? ```hint What k-means gives you Picture clustering only the majority class with as many clusters as the number of majority samples you want to keep. What could you keep from each cluster? ``` ```hint Dense versus sparse regions Compare how many points each method keeps from a dense part of the majority class and from a small, isolated part of it. ``` ### What a Strong Answer Covers - The mechanics: k-means on the majority class only, with the number of clusters set to the target majority size. - The choice between keeping synthetic centroids and keeping the real sample nearest each centroid. - How coverage of rare majority sub-regions and run-to-run variability compare with random undersampling. - What the compression loses: density information, within-class variance, and validity for categorical or sparse features. - Practical costs such as k-means run time and sensitivity to feature scaling. ### Follow-up Questions - When would you keep the real sample nearest each centroid instead of the centroid itself? - How does the lost density information affect the decision boundary and the predicted probabilities? - How would you apply this method to a majority class with tens of millions of rows?

Overview: Asks how cluster-centroid undersampling shrinks the majority class of an imbalanced dataset and how its result differs from random undersampling. Tests the k-means mechanics, what each method keeps from rare and dense regions, and the trade-offs of synthetic centroids.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

You are training a binary classifier on a dataset where the majority class far outnumbers the minority class, and you plan to undersample the majority before training.

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

What a Strong Answer Covers Guidance

  • The mechanics: k-means on the majority class only, with the number of clusters set to the target majority size.
  • The choice between keeping synthetic centroids and keeping the real sample nearest each centroid.
  • How coverage of rare majority sub-regions and run-to-run variability compare with random undersampling.
  • What the compression loses: density information, within-class variance, and validity for categorical or sparse features.
  • Practical costs such as k-means run time and sensitivity to feature scaling.

Follow-up Questions Guidance

  • When would you keep the real sample nearest each centroid instead of the centroid itself?
  • How does the lost density information affect the decision boundary and the predicted probabilities?
  • How would you apply this method to a majority class with tens of millions of rows?