EasyDeepLearn

Class weights vs resampling for imbalance — which do you reach for first?

easy

Answer

  • Class weights (or a weighted loss) first — they're a one-line change, preserve the dataset, don't discard data or synthesize points, and often match resampling in accuracy.
  • If class weights aren't enough (extremely rare positives, non-linear boundary near the minority), try SMOTE variants for oversampling.
  • Combine with threshold tuning at inference for full control.
  • Real answer for tabular data with mild imbalance: classweight\mathrm{class}_{\mathrm{weight}}='balanced' + threshold tuning is usually enough.
Check yourself — multiple choice
  • Always resample first
  • Try class weights + threshold tuning first; escalate to SMOTE variants if still insufficient
  • Never use class weights
  • Undersample as a default

Class weights + threshold tuning is the cheap first line; escalate to SMOTE if needed.

#imbalance

Practise Supervised Learning

215 interview questions in this topic.

Related questions