Module lessons (4/6)
ROC, AUC and imbalanced classes
Rates at every threshold, AUC and class weights.
What you'll learn in this lesson
- Read a ROC curve and explain what AUC measures.
- Compute true and false positive rates at a threshold.
- Handle imbalanced classes with
class_weight.
Overview
A threshold gives one point on the precision-recall trade-off. But what if you want to compare two models before choosing a threshold? The ROC curve plots, for every possible threshold:
A perfect model hugs the top-left corner. A model guessing at random follows the diagonal. The AUC (area under the curve) summarises it: 1.0 is perfect and 0.5 is random guessing. It has a nice meaning: the probability that a randomly chosen positive gets a higher score than a randomly chosen negative.
Sections covered in this lesson
- 1The hook: one number for every threshold
- 2Comparing ranking & imbalance metrics
- 3Imbalanced classes
- 4Progressive examples: ROC curves, AUC, and class weights
- 5Practice
- 6Check your understanding
Unlock "ROC, AUC and imbalanced classes" and the full Machine Learning: from first principles to practice curriculum
Rates at every threshold, AUC and class weights.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Machine Learning: from first principles to practice plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.