IntermediateAbout 19 min
Class Imbalance
Read the full article on Substack
6 min read.
Two cancer-screening models, both with 90% accuracy — one catches 10 of 100 cancers, the other catches 90. Flip which class counts as positive and watch the same model's F1 move from 0.17 to 0.95.
Think of it this way: A smoke alarm that never goes off. In a building that has never had a fire, it is right every single night, and its accuracy is magnificent. The number you wanted was never accuracy.
Check your understanding
Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.
Three levers for imbalance
Sort
Sort each technique by what it changes.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
Resample the data
Drop items hereChange the loss
Drop items hereChange the metric
Drop items here6 pieces left to place
Quiz
20 questionsQuestion 1 of 20
Score: 0
Why does gradient descent struggle to escape the majority-class heuristic?
Done with this lesson?
Sign in free to keep your progress, streak and quiz scores.