How do you adapt resampling strategies when dealing with multi-class imbalanced data?
Last updated
Set per-class target counts (e.g.
sampling_strategyas a dict in imbalanced-learn). Combine undersampling of dominant classes with oversampling rare ones to a moderate floor.Multi-class SMOTE runs one-vs-rest, so synthetic points can land in another minority class's region. Classes smaller than
k_neighbors+ 1 need lower k or random oversampling.Resample only inside training folds via a pipeline with stratified CV, and report macro-F1, per-class recall and the confusion matrix.
class_weight='balanced'or per-class thresholds are simpler alternatives.