EasyDeepLearn

How do you handle class imbalance in a dataset?

medium

Answer

  • Options: (1) resampling — oversample minority (SMOTE) or undersample majority; (2) class weights in the loss function; (3) threshold tuning on the probability output; (4) anomaly-detection framing when positives are extremely rare; (5) collect more minority data.
  • Always evaluate with PR-AUC, F1 or recall at fixed precision — not plain accuracy.
Check yourself — multiple choice
  • Always oversample the majority class
  • Use accuracy as the main metric
  • Use class weights, resampling (SMOTE) or threshold tuning
  • Drop the minority class

Class weights, SMOTE-style resampling, and threshold tuning are the standard remedies.

#imbalance#data-quality

Practise Supervised Learning

215 interview questions in this topic.

Related questions