Member-only story

A short introduction to Cost-Sensitive Learning

Santiago Valdarrama
4 min readMay 28, 2021

--

The best picture I could find related to “mechanical components” in a factory.

Think of a factory.

Now imagine a machine learning model that looks at a picture of a mechanical component and predicts whether it’s about to break.

Don’t worry about how the model does this. Let’s focus on the results instead.

Imagine we run 100 pictures through the model, and we get the following results:

  • 7 components are about to break. These would be “Positive” results from the model.
  • 93 components are fine. These would be “Negative” results from the model.

There’s a lot we can do with this information.

The confusion matrix

Before anything else, it’s always a good idea for a person to manually review each of the model results to understand better how it’s working. Let’s say these are the results we get:

  • Out of the 7 positive model results, 5 of those are about to break, but 2 are fine.
  • Out of the 93 negative results, 91 are fine, but the other 2 are not working as expected.

We can represent this information in a confusion matrix. This is what it’d look like:

--

--

Santiago Valdarrama
Santiago Valdarrama

Written by Santiago Valdarrama

I build machine learning systems until 5 pm. Then I come here and tell you stories about them.

Responses (2)