M2-071M2: Classical Machine LearningClass Imbalance LearningEasy
⚡Flashcard Drill➔Mastery:
Major Approaches for Handling Class Imbalance
🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Address imbalance at the data level (re-sampling), algorithmic level (cost-sensitive loss, Focal Loss), and post-processing level (threshold tuning).
📌 Key Takeaways
- •Data-level: random undersampling, oversampling, SMOTE, ADASYN
- •Algorithm-level: class-weighted loss, Focal Loss, balance cascade ensembling
- •Post-processing: probability calibration followed by cost-optimal threshold shifting
📐 Mathematical Derivations
Taxonomy of Class Imbalance Solutions: ① Re-sampling: Adjust the empirical class distribution to . Undersampling drops majority samples (discards data); Oversampling replicates minority samples (risks overfitting); Synthetic generation (SMOTE) interpolates between nearest minority neighbors. ② Cost-Sensitive Learning: Modify the loss objective with inverse-frequency weights . ③ Focal Loss: , dynamically downweighting easy negative examples. ④ Threshold Moving: Adjust decision boundary based on Bayes risk or business trade-offs.
🏭 Production Trade-offs
Engineering decision matrix: In massive datasets (), Random Undersampling combined with ensembling (e.g., EasyEnsemble) is computationally optimal. In medium datasets, Class Weights or Focal Loss are preferred because they preserve original data distribution and maintain consistent sample sizes. For business KPIs, always couple model training with rigorous post-calibration threshold optimization.
⚠️ Common Interview Pitfalls
- ✕Evaluating models on imbalanced data using accuracy instead of PR-AUC, F1, or cost-weighted matrices
- ✕Applying SMOTE to the entire dataset before train/test splitting, leaking synthetic test points into training
🎯 Interviewer Follow-up Inquiries
- ?When is random undersampling strictly superior to SMOTE in large-scale production systems?
- ?Why does modifying class weights during training distort predicted probabilities, and how do you calibrate them?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚