type
Post
Created date
Jun 16, 2022 01:21 PM
category
Data Science
tags
Machine Learning
Machine Learning
status
Published
Language
From
summary
slug
password
Author
Priority
Featured
Featured
Cover
Origin
Type
URL
Youtube
Youtube
icon
Week 9 : Classification
Confusion Matrix
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2F099d4acd-992b-496c-b79e-ab75da44d44a%2F19gmid6n.bmp%3Ftable%3Dblock%26id%3D43dfb45b-8245-4cc4-aef0-3fafffec6fcd%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1725847200000%26signature%3Dffbh3PVwhmi5gWskk6j_QFTnGq0t38tmtfpUu_b78V0?table=block&id=43dfb45b-8245-4cc4-aef0-3fafffec6fcd&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2F3489d546-9929-4701-9a67-6faab74a11ce%2FUntitled.png%3Ftable%3Dblock%26id%3D4f5b475b-f5af-449d-ab5d-551feeb23839%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1725847200000%26signature%3DWCDYdQ5EUNlSmqKL6DiGs45FEf1ROEzygSJ9UgKLw_8?table=block&id=4f5b475b-f5af-449d-ab5d-551feeb23839&cache=v2)
Interpretation of indicator: (Here)
- Proportion of times the classifier is correct
![This is useful, code found in ETC2420 lecture slide week 9.](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2F8eddfd39-cebe-455b-9849-fcf76cecc101%2FUntitled.png%3Ftable%3Dblock%26id%3Dade9f28b-2bc5-4d57-ad05-ff061c954549%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1725847200000%26signature%3D59BMvP6wKsVXE0u3NhuJcd-t1N14b31QspLdfwr-AHQ?table=block&id=ade9f28b-2bc5-4d57-ad05-ff061c954549&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2Fe1c5ba0e-562a-49b0-8505-ce5e38fc061b%2Fc6cfb7e4-7906-41eb-b65c-87dd66537c44%2FUntitled.png%3Ftable%3Dblock%26id%3D855cb8d3-90bc-4a0c-af61-b32e310fa425%26spaceId%3De1c5ba0e-562a-49b0-8505-ce5e38fc061b%26expirationTimestamp%3D1725847200000%26signature%3DQOB3zIeMR3fI4a0P1QzscllHLh59_iiUsKX8TwBel1k?table=block&id=855cb8d3-90bc-4a0c-af61-b32e310fa425&cache=v2)
Precision (吾係變係)
- To determine the best model when the costs of False Positive is high.
- For instance, email spam detection.
- In email spam detection, a false positive means that an email that is non-spam (actual negative) has been identified as spam (predicted spam).
- The email user might lose important emails if the precision is not high for the spam detection model.
Recall (係變吾係) aka Sensitivity
% of predicting a YES as YES = Low values imply that the model does not predict thepositive
class well.
- To determine the best model when the cost associated with False Negative is high.
- Calculates how many of the Actual Positives our model capture through labeling it as Positive (True Positive).
- For instance of fraud detection,
- If a fraudulent transaction (Actual Positive) is predicted as non-fraudulent (Predicted Negative), the consequence can be very bad for the bank.
- For instance of sick patient detection,
- Similarly, in sick patient detection, if a sick patient (Actual Positive) goes through the test and predicted as not sick (Predicted Negative).
- The cost associated with False Negative will be extremely high if the sickness is contagious.
Specificity
% of predicting a NO as NO = Low values imply that the model does not predict thenegative
class well.
FAQ
for the class is highly imbalanced, do we always go for balanced accuracy over the overall accuracy?
generally yes. Otherwise it might as well be a single class problem, because the best strategy is to predict to be majority class!
However, it can be depend on the application. Or the use of a different metric that combines the class accuracy in different ways.
- Author:Jason Siu
- URL:https://jason-siu.com/article/3287efa9-48ab-44aa-9d19-346bee3d72f4
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts