More about imbalanced classes

In the preceding examples, you might have noticed that many prediction problems suffer from a phenomenon where one class occurs much more frequently than the others. Identifying diseases such as cancer, estimating probabilities of credit default, or detecting fraud in financial transactions are all examples of imbalanced problems – positive cases are much less frequent than the negative ones. In such situations, estimating classifier performance becomes tricky. Metrics such as accuracy start to show an overly optimistic picture, so you need to resort to more advanced technical metrics. The F1 score gives much more realistic values in this setting. However, the F1 score is calculated from class assignments (0 ...

Get Managing Data Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.