Week 5 — Lesson 5: Thresholds and class imbalance

3 min

Only 7.5 % of the NorthPeak rows are faults. With a class this rare, accuracy is useless and the default threshold of 0.5 is wrong for the job. A missed fault costs far more than a visit, so an alarm should fire well before the odds reach one in two. This lesson walks the same logistic regression through five thresholds on the test quarter, prices each choice with a cost per error, and presents class_weight="balanced" as a second lever against imbalance.

Preview — the rest of the lesson is for enrolled readers.

Already enrolled with a code?

Your access is tied to your account, not to this link. Sign in with the same email you used in class: your course is waiting, no need to enter the code again.

Sign inNo account yet? Create one
This lesson is part of the “Week 5 — Regression, classification and evaluation” module

The first modules of the course are open to everyone. For the rest you have three options: buy this course once and for all, subscribe, or enter the code handed out in class.

Are you a student on this course?

The code is tied to your account: sign in or create an account and it will be applied automatically when you come back.

No account yet? Create one