Technology
Business
Artificial Intelligence
Data Science
Retail
Machine Learning
Accuracy in Predictive Models
Shoplifting Prevention
If you basically said that everyone was not a shoplifter, you'd be correct in 95 out of 100 cases, which is what the model did.
You would be wrong in the other 5 cases, but who cares?
We're still 95% accurate, but this is clearly not what we are looking for.
You would be wrong in the other 5 cases, but who cares?
We're still 95% accurate, but this is clearly not what we are looking for.
Moral of the story: Accuracy is not a suitable metric to use in situations where the data is skewed.
Then, how do we solve this problem?
đđť
Then, how do we solve this problem?
đđť
SĚśtĚśoĚśpĚś ĚśuĚśsĚśiĚśnĚśgĚś ĚśmĚśaĚścĚśhĚśiĚśnĚśeĚś ĚślĚśeĚśaĚśrĚśnĚśiĚśnĚśgĚś ĚśaĚśnĚśdĚś ĚśjĚśuĚśsĚśtĚś ĚśiĚśnĚśvĚśeĚśsĚśtĚśiĚśgĚśaĚśtĚśeĚś ĚśeĚśvĚśeĚśrĚśyĚś ĚścĚśuĚśsĚśtĚśoĚśmĚśeĚśrĚś.
Evaluate your model using a different metric, let us take a look at recall and precision, but first, it is important to understand some terminology.
Evaluate your model using a different metric, let us take a look at recall and precision, but first, it is important to understand some terminology.
Let's co-relate this to our case of shoplifting.
Case 1: Our model predicts someone shoplifted when they actually did (TP - True Positive)
Case 2: Our model predicts someone shoplifted when they didn't (FP - False Positive)
Case 1: Our model predicts someone shoplifted when they actually did (TP - True Positive)
Case 2: Our model predicts someone shoplifted when they didn't (FP - False Positive)
Case 3: Our model predicts someone did not shoplift when they did (FN - False Negative)
Case 4: Our model predicts someone did not shoplift when they didn't (TN - True Negative)
Whenever you're confused, just refer to the above meme.
Case 4: Our model predicts someone did not shoplift when they didn't (TN - True Negative)
Whenever you're confused, just refer to the above meme.
Now if the model classifies everyone as a shoplifter, it is going to have 0 recall.
This means it is "not good at all" if we are optimizing to have as high of recall as possible.
On the flip side, what if we label everyone as a shoplifter?
This means it is "not good at all" if we are optimizing to have as high of recall as possible.
On the flip side, what if we label everyone as a shoplifter?
We'll have a recall of 100%, after all, recall just cares about not missing shoplifters, not about false accusations on customers (False Positive).
But there is a metric that does care about false accusations on customers, precision.
But there is a metric that does care about false accusations on customers, precision.
By this point, you might've guessed what problem we will encounter if we only optimize for high precision in our model.
The model can just call everyone not a shoplifter and have high precision.
The model can just call everyone not a shoplifter and have high precision.
Recall and precision are related such that high precision leads to low recall, and low precision leads to high recall.
We obviously want both to as high as possible, is there any metric that combines both precision and recall?
Say hello to the Fâ score đđť
We obviously want both to as high as possible, is there any metric that combines both precision and recall?
Say hello to the Fâ score đđť
Now if we optimize our model to have an Fâ score, we can have high precision and recall.
This translates to our model being able to catch shoplifters and at the same time not falsely accuse innocent customers.
This translates to our model being able to catch shoplifters and at the same time not falsely accuse innocent customers.
3 typos in the thread:
- Everyone -> no one
- Ambiguity in the statement ( Correct: Out of all the cases we predicted as positive, how many are actually positive )
- The formula for f1
Thanks for catching this! @JREB1990 @notnotAmine
- Everyone -> no one
- Ambiguity in the statement ( Correct: Out of all the cases we predicted as positive, how many are actually positive )
- The formula for f1
Thanks for catching this! @JREB1990 @notnotAmine
If you'd like to read this thread later, you can save it as a blog post.
prathamprasoon.codes
prathamprasoon.codes
This example was chosen just to illustrate a point.
There are many complex ethical issues that arise when collecting data for such issues which I do not know much about.
Maybe a thread for another day...
There are many complex ethical issues that arise when collecting data for such issues which I do not know much about.
Maybe a thread for another day...
Loading suggestions...