How do you handle class imbalance in a dataset?
medium- 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.