SlideShare a Scribd company logo
Data Science
Model Performance Metrics
(Accuracy, Precision, Recall)
Model Performance Metrics
Model performance metrics are measurements used to evaluate the effectiveness
and efficiency of a predictive model or machine learning algorithm.
To evaluate the performance of predictive model there are metrics:
Accuracy
Precision
Recall (Sensitivity)
F1-Score
Confusion Matrix
ROC Curve and AUC
Please check the description box for the link to Machine Learning videos.
TP TN FP FN
A true positive is an outcome where the model correctly predicts the
positive class. Similarly, a true negative is an outcome where the
model correctly predicts the negative class.
A false positive is an outcome where the model incorrectly predicts
the positive class. And a false negative is an outcome where the
model incorrectly predicts the negative class.
Predicted Positive Negative
Positive
Negative
Actual
True Positive TP
True Negative TN
False Negative FN
False Positive FP
Accuracy
Accuracy: Accuracy is the ratio of the number of correct predictions and the
total number of predictions. It is calculated as-
Accuracy = (TP + TN) / (TP + TN + FP + FN)
Accuracy is useful in binary classification with balanced classes, also be used
for evaluating multiclass classification model when classes are balanced.
When classes in the dataset are highly imbalanced, meaning there is a
significant disparity in the number of instances between classes, accuracy can
be misleading. A model may achieve high accuracy by simply predicting the
majority class for every instance, ignoring the minority class entirely.
Example
let's consider a medical diagnosis scenario where we are developing a
model to predict whether a patient has a rare disease or not. Suppose we
have a dataset of 100 patients, out of which only 2 have the disease. This
dataset represents a highly imbalanced scenario.
let's say we develop a simple classifier that always predicts that a patient
does not have the disease. Despite the high accuracy of 98%, this classifier
is not useful because it fails to identify any patients with the disease. It
simply predicts that every patient is disease-free.
In such cases, evaluation metrics like precision, recall, or F1-score provide
more insightful information about the model's performance, especially
concerning its ability to correctly identify the minority class (patients with
the disease).
Precision
Precision: Precision is a measure of a model’s performance that tells us how
many of the positive predictions made by the model are actually correct. It is
calculated as-
Precision = TP / (TP + FP)
Precision is particularly useful in scenarios where the cost of false positives
is high.
The importance of precision is in music or video recommendation systems,
e-commerce websites, etc. where wrong results could lead to customer churn,
and this could be harmful to the business.
It gives us insight into the model's ability to avoid false positives, A higher
precision indicates fewer false positives.
Example
• Suppose we have a dataset of 1000 emails, out of which 200 are spam
(positive class) and 800 are not spam (negative class). After training our
spam detection model, it predicts that 250 emails are spam.
• True Positives (TP): 150 (correctly identified spam emails)
• False Positives (FP): 100 (non-spam emails incorrectly classified as
spam)
• Using these numbers, let's calculate precision:
• Precision=150/150+100=150/250 =0.6
• So, the precision of the model is 0.6 or 60%. This means that out of all
the emails predicted as spam, 60% of them are actually spam.
Recall (Sensitivity)
Recall: Also known as sensitivity or true positive rate, recall measures the
proportion of true positive predictions among all actual positive instances in
the dataset. It is calculated as-
Recall = TP / (TP + FN).
Recall is particularly useful in scenarios where capturing all positive instances
is crucial, even if it means accepting a higher rate of false positives.
In medical diagnosis, missing a positive instance (false negative) can have
severe consequences for the patient's health or even lead to loss of life. High
recall ensures that the model identifies as many positive cases as possible,
reducing the likelihood of missing critical diagnoses.
It gives us insight into the model's ability to avoid false negatives, which are
cases where patients with the disease are incorrectly diagnosed as not having
it.
Example
• Suppose we have a dataset of 100 patients who were tested for a specific
disease, where 20 patients actually have the disease (positive class), and 80
patients do not have the disease (negative class).
• After training our diagnostic model,
• True Positives (TP): 15 (patients correctly diagnosed with the disease)
• False Positives (FP): 5 (patients incorrectly diagnosed with the disease)
• False Negatives (FN): 5 (patients with the disease incorrectly diagnosed as not
having the disease)
• True Negatives (TN): 75 (patients correctly diagnosed as not having the disease)
• Recall= 15/15+5 =15/20 =0.75
Precision vs Recall
• Precision can be seen as a
measure of quality.
• Higher precision means that an
algorithm returns more relevant
results than irrelevant ones.
• Precision measures the accuracy
of positive predictions.
• Precision is important when the
cost of false positives is high.
(e.g. spam detection).
• Recall can be seen as a measure of
quantity.
• Higher recall means that an
algorithm returns most of the
relevant results (whether irrelevant
ones are also returned).
• Recall measures the completeness of
positive predictions.
• Recall is important when the cost of
false negative is high. (e.g. disease
diagnosis)
Thanks for Watching!
Please check the description box for the link to
Machine Learning videos.
Ad

More Related Content

What's hot (20)

Data mining technique (decision tree)
Data mining technique (decision tree)Data mining technique (decision tree)
Data mining technique (decision tree)
Shweta Ghate
 
Anomaly detection with machine learning at scale
Anomaly detection with machine learning at scaleAnomaly detection with machine learning at scale
Anomaly detection with machine learning at scale
Impetus Technologies
 
05 Clustering in Data Mining
05 Clustering in Data Mining05 Clustering in Data Mining
05 Clustering in Data Mining
Valerii Klymchuk
 
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & KamberChapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
error007
 
Data Wrangling_1.pptx
Data Wrangling_1.pptxData Wrangling_1.pptx
Data Wrangling_1.pptx
PallabiSahoo5
 
Supervised and Unsupervised Machine Learning
Supervised and Unsupervised Machine LearningSupervised and Unsupervised Machine Learning
Supervised and Unsupervised Machine Learning
Spotle.ai
 
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Simplilearn
 
Data Mining: Association Rules Basics
Data Mining: Association Rules BasicsData Mining: Association Rules Basics
Data Mining: Association Rules Basics
Benazir Income Support Program (BISP)
 
Confusion Matrix
Confusion MatrixConfusion Matrix
Confusion Matrix
Rajat Gupta
 
Data mining: Classification and prediction
Data mining: Classification and predictionData mining: Classification and prediction
Data mining: Classification and prediction
DataminingTools Inc
 
Dbms 3: 3 Schema Architecture
Dbms 3: 3 Schema ArchitectureDbms 3: 3 Schema Architecture
Dbms 3: 3 Schema Architecture
Amiya9439793168
 
Data Preprocessing
Data PreprocessingData Preprocessing
Data Preprocessing
Object-Frontier Software Pvt. Ltd
 
An Introduction to Anomaly Detection
An Introduction to Anomaly DetectionAn Introduction to Anomaly Detection
An Introduction to Anomaly Detection
Kenneth Graham
 
Semi-Supervised Learning
Semi-Supervised LearningSemi-Supervised Learning
Semi-Supervised Learning
Lukas Tencer
 
Lecture13 - Association Rules
Lecture13 - Association RulesLecture13 - Association Rules
Lecture13 - Association Rules
Albert Orriols-Puig
 
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic ConceptsData Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Salah Amean
 
Machine learning algorithms
Machine learning algorithmsMachine learning algorithms
Machine learning algorithms
Shalitha Suranga
 
Lecture 1: What is Machine Learning?
Lecture 1: What is Machine Learning?Lecture 1: What is Machine Learning?
Lecture 1: What is Machine Learning?
Marina Santini
 
Supervised Machine Learning
Supervised Machine LearningSupervised Machine Learning
Supervised Machine Learning
Ankit Rai
 
Decision tree
Decision treeDecision tree
Decision tree
Ami_Surati
 
Data mining technique (decision tree)
Data mining technique (decision tree)Data mining technique (decision tree)
Data mining technique (decision tree)
Shweta Ghate
 
Anomaly detection with machine learning at scale
Anomaly detection with machine learning at scaleAnomaly detection with machine learning at scale
Anomaly detection with machine learning at scale
Impetus Technologies
 
05 Clustering in Data Mining
05 Clustering in Data Mining05 Clustering in Data Mining
05 Clustering in Data Mining
Valerii Klymchuk
 
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & KamberChapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
Chapter - 6 Data Mining Concepts and Techniques 2nd Ed slides Han & Kamber
error007
 
Data Wrangling_1.pptx
Data Wrangling_1.pptxData Wrangling_1.pptx
Data Wrangling_1.pptx
PallabiSahoo5
 
Supervised and Unsupervised Machine Learning
Supervised and Unsupervised Machine LearningSupervised and Unsupervised Machine Learning
Supervised and Unsupervised Machine Learning
Spotle.ai
 
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Simplilearn
 
Confusion Matrix
Confusion MatrixConfusion Matrix
Confusion Matrix
Rajat Gupta
 
Data mining: Classification and prediction
Data mining: Classification and predictionData mining: Classification and prediction
Data mining: Classification and prediction
DataminingTools Inc
 
Dbms 3: 3 Schema Architecture
Dbms 3: 3 Schema ArchitectureDbms 3: 3 Schema Architecture
Dbms 3: 3 Schema Architecture
Amiya9439793168
 
An Introduction to Anomaly Detection
An Introduction to Anomaly DetectionAn Introduction to Anomaly Detection
An Introduction to Anomaly Detection
Kenneth Graham
 
Semi-Supervised Learning
Semi-Supervised LearningSemi-Supervised Learning
Semi-Supervised Learning
Lukas Tencer
 
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic ConceptsData Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Salah Amean
 
Machine learning algorithms
Machine learning algorithmsMachine learning algorithms
Machine learning algorithms
Shalitha Suranga
 
Lecture 1: What is Machine Learning?
Lecture 1: What is Machine Learning?Lecture 1: What is Machine Learning?
Lecture 1: What is Machine Learning?
Marina Santini
 
Supervised Machine Learning
Supervised Machine LearningSupervised Machine Learning
Supervised Machine Learning
Ankit Rai
 

Similar to Model Performance Metrics. Accuracy, Precision, Recall (20)

04 performance metrics v2
04 performance metrics v204 performance metrics v2
04 performance metrics v2
Anne Starr
 
Performance Metrics, Baseline Model, and Hyper Parameter
Performance Metrics, Baseline Model, and Hyper ParameterPerformance Metrics, Baseline Model, and Hyper Parameter
Performance Metrics, Baseline Model, and Hyper Parameter
IndraFransiskusAlam1
 
evaluationmeasures-ml.pdf evaluation measures
evaluationmeasures-ml.pdf evaluation measuresevaluationmeasures-ml.pdf evaluation measures
evaluationmeasures-ml.pdf evaluation measures
shalinipriya1692
 
Machine learning session5(logistic regression)
Machine learning   session5(logistic regression)Machine learning   session5(logistic regression)
Machine learning session5(logistic regression)
Abhimanyu Dwivedi
 
Confusion matrix and classification evaluation metrics
Confusion matrix and classification evaluation metricsConfusion matrix and classification evaluation metrics
Confusion matrix and classification evaluation metrics
Minesh A. Jethva
 
Evaluation Metrics for Classification and Regression
Evaluation Metrics for Classification and RegressionEvaluation Metrics for Classification and Regression
Evaluation Metrics for Classification and Regression
rahuljain582793
 
alkdjnsalkjdnaklsjdnalksjdnakldaslkdjnaskldnaskjdn
alkdjnsalkjdnaklsjdnalksjdnakldaslkdjnaskldnaskjdnalkdjnsalkjdnaklsjdnalksjdnakldaslkdjnaskldnaskjdn
alkdjnsalkjdnaklsjdnalksjdnakldaslkdjnaskldnaskjdn
moonavalance
 
MACHINE LEARNING PPT K MEANS CLUSTERING.
MACHINE LEARNING PPT K MEANS CLUSTERING.MACHINE LEARNING PPT K MEANS CLUSTERING.
MACHINE LEARNING PPT K MEANS CLUSTERING.
AmnaArooj13
 
Important Classification and Regression Metrics.pptx
Important Classification and Regression Metrics.pptxImportant Classification and Regression Metrics.pptx
Important Classification and Regression Metrics.pptx
Chode Amarnath
 
Performance of the classification algorithm
Performance of the classification algorithmPerformance of the classification algorithm
Performance of the classification algorithm
Hoopeer Hoopeer
 
Confusion Matrix for Machine Learning and its details
Confusion Matrix for Machine Learning and its detailsConfusion Matrix for Machine Learning and its details
Confusion Matrix for Machine Learning and its details
HusainParvez6
 
Statistics
StatisticsStatistics
Statistics
fracpractice
 
Basics of Sample Size Estimation
Basics of Sample Size EstimationBasics of Sample Size Estimation
Basics of Sample Size Estimation
Mandar Baviskar
 
Unit 9b. Sample size estimation.ppt
Unit 9b. Sample size estimation.pptUnit 9b. Sample size estimation.ppt
Unit 9b. Sample size estimation.ppt
shakirRahman10
 
The Lachman Test
The Lachman TestThe Lachman Test
The Lachman Test
Laura Torres
 
Model Evaluation Matrix: Confusion Matrix, F1 Score, ROC curve AUC
Model Evaluation Matrix: Confusion Matrix, F1 Score, ROC curve AUCModel Evaluation Matrix: Confusion Matrix, F1 Score, ROC curve AUC
Model Evaluation Matrix: Confusion Matrix, F1 Score, ROC curve AUC
Megha Sharma
 
Performance Measurement for Machine Leaning.pptx
Performance Measurement for Machine Leaning.pptxPerformance Measurement for Machine Leaning.pptx
Performance Measurement for Machine Leaning.pptx
toneve4907
 
Assessing Model Performance - Beginner's Guide
Assessing Model Performance - Beginner's GuideAssessing Model Performance - Beginner's Guide
Assessing Model Performance - Beginner's Guide
Megan Verbakel
 
Lecture 5_Assessing Model Performance.pptx
Lecture 5_Assessing Model Performance.pptxLecture 5_Assessing Model Performance.pptx
Lecture 5_Assessing Model Performance.pptx
MdMujahidHasan1
 
Calculating a Sample Size
Calculating a Sample SizeCalculating a Sample Size
Calculating a Sample Size
Matt Hansen
 
04 performance metrics v2
04 performance metrics v204 performance metrics v2
04 performance metrics v2
Anne Starr
 
Performance Metrics, Baseline Model, and Hyper Parameter
Performance Metrics, Baseline Model, and Hyper ParameterPerformance Metrics, Baseline Model, and Hyper Parameter
Performance Metrics, Baseline Model, and Hyper Parameter
IndraFransiskusAlam1
 
evaluationmeasures-ml.pdf evaluation measures
evaluationmeasures-ml.pdf evaluation measuresevaluationmeasures-ml.pdf evaluation measures
evaluationmeasures-ml.pdf evaluation measures
shalinipriya1692
 
Machine learning session5(logistic regression)
Machine learning   session5(logistic regression)Machine learning   session5(logistic regression)
Machine learning session5(logistic regression)
Abhimanyu Dwivedi
 
Confusion matrix and classification evaluation metrics
Confusion matrix and classification evaluation metricsConfusion matrix and classification evaluation metrics
Confusion matrix and classification evaluation metrics
Minesh A. Jethva
 
Evaluation Metrics for Classification and Regression
Evaluation Metrics for Classification and RegressionEvaluation Metrics for Classification and Regression
Evaluation Metrics for Classification and Regression
rahuljain582793
 
alkdjnsalkjdnaklsjdnalksjdnakldaslkdjnaskldnaskjdn
alkdjnsalkjdnaklsjdnalksjdnakldaslkdjnaskldnaskjdnalkdjnsalkjdnaklsjdnalksjdnakldaslkdjnaskldnaskjdn
alkdjnsalkjdnaklsjdnalksjdnakldaslkdjnaskldnaskjdn
moonavalance
 
MACHINE LEARNING PPT K MEANS CLUSTERING.
MACHINE LEARNING PPT K MEANS CLUSTERING.MACHINE LEARNING PPT K MEANS CLUSTERING.
MACHINE LEARNING PPT K MEANS CLUSTERING.
AmnaArooj13
 
Important Classification and Regression Metrics.pptx
Important Classification and Regression Metrics.pptxImportant Classification and Regression Metrics.pptx
Important Classification and Regression Metrics.pptx
Chode Amarnath
 
Performance of the classification algorithm
Performance of the classification algorithmPerformance of the classification algorithm
Performance of the classification algorithm
Hoopeer Hoopeer
 
Confusion Matrix for Machine Learning and its details
Confusion Matrix for Machine Learning and its detailsConfusion Matrix for Machine Learning and its details
Confusion Matrix for Machine Learning and its details
HusainParvez6
 
Basics of Sample Size Estimation
Basics of Sample Size EstimationBasics of Sample Size Estimation
Basics of Sample Size Estimation
Mandar Baviskar
 
Unit 9b. Sample size estimation.ppt
Unit 9b. Sample size estimation.pptUnit 9b. Sample size estimation.ppt
Unit 9b. Sample size estimation.ppt
shakirRahman10
 
Model Evaluation Matrix: Confusion Matrix, F1 Score, ROC curve AUC
Model Evaluation Matrix: Confusion Matrix, F1 Score, ROC curve AUCModel Evaluation Matrix: Confusion Matrix, F1 Score, ROC curve AUC
Model Evaluation Matrix: Confusion Matrix, F1 Score, ROC curve AUC
Megha Sharma
 
Performance Measurement for Machine Leaning.pptx
Performance Measurement for Machine Leaning.pptxPerformance Measurement for Machine Leaning.pptx
Performance Measurement for Machine Leaning.pptx
toneve4907
 
Assessing Model Performance - Beginner's Guide
Assessing Model Performance - Beginner's GuideAssessing Model Performance - Beginner's Guide
Assessing Model Performance - Beginner's Guide
Megan Verbakel
 
Lecture 5_Assessing Model Performance.pptx
Lecture 5_Assessing Model Performance.pptxLecture 5_Assessing Model Performance.pptx
Lecture 5_Assessing Model Performance.pptx
MdMujahidHasan1
 
Calculating a Sample Size
Calculating a Sample SizeCalculating a Sample Size
Calculating a Sample Size
Matt Hansen
 
Ad

More from Megha Sharma (20)

Designing Printed Circuit boards, Software Choices, The Design Process
Designing Printed Circuit boards, Software Choices, The Design ProcessDesigning Printed Circuit boards, Software Choices, The Design Process
Designing Printed Circuit boards, Software Choices, The Design Process
Megha Sharma
 
Manufacturing PCB, Etching board, milling board, Third party manufacturing, a...
Manufacturing PCB, Etching board, milling board, Third party manufacturing, a...Manufacturing PCB, Etching board, milling board, Third party manufacturing, a...
Manufacturing PCB, Etching board, milling board, Third party manufacturing, a...
Megha Sharma
 
Business Model, make thing, sell thing, subscription, customization, Key Reso...
Business Model, make thing, sell thing, subscription, customization, Key Reso...Business Model, make thing, sell thing, subscription, customization, Key Reso...
Business Model, make thing, sell thing, subscription, customization, Key Reso...
Megha Sharma
 
Funding an IOT startup, Venture Capital, Government funding, Crowdfunding, Le...
Funding an IOT startup, Venture Capital, Government funding, Crowdfunding, Le...Funding an IOT startup, Venture Capital, Government funding, Crowdfunding, Le...
Funding an IOT startup, Venture Capital, Government funding, Crowdfunding, Le...
Megha Sharma
 
Sketch, Iterate and Explore, Nondigital Methods.
Sketch, Iterate and Explore, Nondigital Methods.Sketch, Iterate and Explore, Nondigital Methods.
Sketch, Iterate and Explore, Nondigital Methods.
Megha Sharma
 
CNC Milling, Software, Repurposing and Recycling.
CNC Milling, Software, Repurposing and Recycling.CNC Milling, Software, Repurposing and Recycling.
CNC Milling, Software, Repurposing and Recycling.
Megha Sharma
 
3D printing, Types of 3D printing: FDM, Laser Sintering, Powder bed, LOM, DLP.
3D printing, Types of 3D printing: FDM,  Laser Sintering,  Powder bed, LOM, DLP.3D printing, Types of 3D printing: FDM,  Laser Sintering,  Powder bed, LOM, DLP.
3D printing, Types of 3D printing: FDM, Laser Sintering, Powder bed, LOM, DLP.
Megha Sharma
 
Laser Cutting, Choosing a laser cutter, Software, Hinges and joints.
Laser Cutting, Choosing a laser cutter, Software, Hinges and joints.Laser Cutting, Choosing a laser cutter, Software, Hinges and joints.
Laser Cutting, Choosing a laser cutter, Software, Hinges and joints.
Megha Sharma
 
Memory management, Types of memory, Making the most of your RAM.
Memory management, Types of memory, Making the most of your RAM.Memory management, Types of memory, Making the most of your RAM.
Memory management, Types of memory, Making the most of your RAM.
Megha Sharma
 
Performance and Battery Life, Libraries, Debugging.
Performance and Battery Life, Libraries, Debugging.Performance and Battery Life, Libraries, Debugging.
Performance and Battery Life, Libraries, Debugging.
Megha Sharma
 
Prototyping Embedded Devices: Arduino, Developing on the Arduino.
Prototyping Embedded Devices: Arduino, Developing on the Arduino.Prototyping Embedded Devices: Arduino, Developing on the Arduino.
Prototyping Embedded Devices: Arduino, Developing on the Arduino.
Megha Sharma
 
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Megha Sharma
 
Open Source versus Closed Source in IOT in IOT
Open Source versus Closed Source in IOT in IOTOpen Source versus Closed Source in IOT in IOT
Open Source versus Closed Source in IOT in IOT
Megha Sharma
 
Why closed? Why Open? Mixing open and closed source
Why closed? Why Open? Mixing open and closed sourceWhy closed? Why Open? Mixing open and closed source
Why closed? Why Open? Mixing open and closed source
Megha Sharma
 
Graceful Degradation and Affordance in IOT
Graceful Degradation and Affordance in IOTGraceful Degradation and Affordance in IOT
Graceful Degradation and Affordance in IOT
Megha Sharma
 
Web thinking connected device, Small Pieces Loosely joined.
Web thinking connected device, Small Pieces Loosely joined.Web thinking connected device, Small Pieces Loosely joined.
Web thinking connected device, Small Pieces Loosely joined.
Megha Sharma
 
Production & Mass Personalization, Changing Embedded Platform, Physical proto...
Production & Mass Personalization, Changing Embedded Platform, Physical proto...Production & Mass Personalization, Changing Embedded Platform, Physical proto...
Production & Mass Personalization, Changing Embedded Platform, Physical proto...
Megha Sharma
 
Whose data is it anyways? Public vs Private data collection.
Whose data is it anyways? Public vs Private data collection.Whose data is it anyways? Public vs Private data collection.
Whose data is it anyways? Public vs Private data collection.
Megha Sharma
 
Thinking about Prototyping: Sketching, Familiarity, Cost versus Ease of proto...
Thinking about Prototyping: Sketching, Familiarity, Cost versus Ease of proto...Thinking about Prototyping: Sketching, Familiarity, Cost versus Ease of proto...
Thinking about Prototyping: Sketching, Familiarity, Cost versus Ease of proto...
Megha Sharma
 
Magic as metaphor in Internet of Things.
Magic as metaphor in Internet of Things.Magic as metaphor in Internet of Things.
Magic as metaphor in Internet of Things.
Megha Sharma
 
Designing Printed Circuit boards, Software Choices, The Design Process
Designing Printed Circuit boards, Software Choices, The Design ProcessDesigning Printed Circuit boards, Software Choices, The Design Process
Designing Printed Circuit boards, Software Choices, The Design Process
Megha Sharma
 
Manufacturing PCB, Etching board, milling board, Third party manufacturing, a...
Manufacturing PCB, Etching board, milling board, Third party manufacturing, a...Manufacturing PCB, Etching board, milling board, Third party manufacturing, a...
Manufacturing PCB, Etching board, milling board, Third party manufacturing, a...
Megha Sharma
 
Business Model, make thing, sell thing, subscription, customization, Key Reso...
Business Model, make thing, sell thing, subscription, customization, Key Reso...Business Model, make thing, sell thing, subscription, customization, Key Reso...
Business Model, make thing, sell thing, subscription, customization, Key Reso...
Megha Sharma
 
Funding an IOT startup, Venture Capital, Government funding, Crowdfunding, Le...
Funding an IOT startup, Venture Capital, Government funding, Crowdfunding, Le...Funding an IOT startup, Venture Capital, Government funding, Crowdfunding, Le...
Funding an IOT startup, Venture Capital, Government funding, Crowdfunding, Le...
Megha Sharma
 
Sketch, Iterate and Explore, Nondigital Methods.
Sketch, Iterate and Explore, Nondigital Methods.Sketch, Iterate and Explore, Nondigital Methods.
Sketch, Iterate and Explore, Nondigital Methods.
Megha Sharma
 
CNC Milling, Software, Repurposing and Recycling.
CNC Milling, Software, Repurposing and Recycling.CNC Milling, Software, Repurposing and Recycling.
CNC Milling, Software, Repurposing and Recycling.
Megha Sharma
 
3D printing, Types of 3D printing: FDM, Laser Sintering, Powder bed, LOM, DLP.
3D printing, Types of 3D printing: FDM,  Laser Sintering,  Powder bed, LOM, DLP.3D printing, Types of 3D printing: FDM,  Laser Sintering,  Powder bed, LOM, DLP.
3D printing, Types of 3D printing: FDM, Laser Sintering, Powder bed, LOM, DLP.
Megha Sharma
 
Laser Cutting, Choosing a laser cutter, Software, Hinges and joints.
Laser Cutting, Choosing a laser cutter, Software, Hinges and joints.Laser Cutting, Choosing a laser cutter, Software, Hinges and joints.
Laser Cutting, Choosing a laser cutter, Software, Hinges and joints.
Megha Sharma
 
Memory management, Types of memory, Making the most of your RAM.
Memory management, Types of memory, Making the most of your RAM.Memory management, Types of memory, Making the most of your RAM.
Memory management, Types of memory, Making the most of your RAM.
Megha Sharma
 
Performance and Battery Life, Libraries, Debugging.
Performance and Battery Life, Libraries, Debugging.Performance and Battery Life, Libraries, Debugging.
Performance and Battery Life, Libraries, Debugging.
Megha Sharma
 
Prototyping Embedded Devices: Arduino, Developing on the Arduino.
Prototyping Embedded Devices: Arduino, Developing on the Arduino.Prototyping Embedded Devices: Arduino, Developing on the Arduino.
Prototyping Embedded Devices: Arduino, Developing on the Arduino.
Megha Sharma
 
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Megha Sharma
 
Open Source versus Closed Source in IOT in IOT
Open Source versus Closed Source in IOT in IOTOpen Source versus Closed Source in IOT in IOT
Open Source versus Closed Source in IOT in IOT
Megha Sharma
 
Why closed? Why Open? Mixing open and closed source
Why closed? Why Open? Mixing open and closed sourceWhy closed? Why Open? Mixing open and closed source
Why closed? Why Open? Mixing open and closed source
Megha Sharma
 
Graceful Degradation and Affordance in IOT
Graceful Degradation and Affordance in IOTGraceful Degradation and Affordance in IOT
Graceful Degradation and Affordance in IOT
Megha Sharma
 
Web thinking connected device, Small Pieces Loosely joined.
Web thinking connected device, Small Pieces Loosely joined.Web thinking connected device, Small Pieces Loosely joined.
Web thinking connected device, Small Pieces Loosely joined.
Megha Sharma
 
Production & Mass Personalization, Changing Embedded Platform, Physical proto...
Production & Mass Personalization, Changing Embedded Platform, Physical proto...Production & Mass Personalization, Changing Embedded Platform, Physical proto...
Production & Mass Personalization, Changing Embedded Platform, Physical proto...
Megha Sharma
 
Whose data is it anyways? Public vs Private data collection.
Whose data is it anyways? Public vs Private data collection.Whose data is it anyways? Public vs Private data collection.
Whose data is it anyways? Public vs Private data collection.
Megha Sharma
 
Thinking about Prototyping: Sketching, Familiarity, Cost versus Ease of proto...
Thinking about Prototyping: Sketching, Familiarity, Cost versus Ease of proto...Thinking about Prototyping: Sketching, Familiarity, Cost versus Ease of proto...
Thinking about Prototyping: Sketching, Familiarity, Cost versus Ease of proto...
Megha Sharma
 
Magic as metaphor in Internet of Things.
Magic as metaphor in Internet of Things.Magic as metaphor in Internet of Things.
Magic as metaphor in Internet of Things.
Megha Sharma
 
Ad

Recently uploaded (20)

To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-26-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-26-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-26-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-26-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Unit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theoriesUnit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theories
bharath321164
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
High Performance Liquid Chromatography .pptx
High Performance Liquid Chromatography .pptxHigh Performance Liquid Chromatography .pptx
High Performance Liquid Chromatography .pptx
Ayush Srivastava
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Studying Drama: Definition, types and elements
Studying Drama: Definition, types and elementsStudying Drama: Definition, types and elements
Studying Drama: Definition, types and elements
AbdelFattahAdel2
 
Open Access: Revamping Library Learning Resources.
Open Access: Revamping Library Learning Resources.Open Access: Revamping Library Learning Resources.
Open Access: Revamping Library Learning Resources.
Rishi Bankim Chandra Evening College, Naihati, North 24 Parganas, West Bengal, India
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Timber Pitch Roof Construction Measurement-2024.pptx
Timber Pitch Roof Construction Measurement-2024.pptxTimber Pitch Roof Construction Measurement-2024.pptx
Timber Pitch Roof Construction Measurement-2024.pptx
Tantish QS, UTM
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Unit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theoriesUnit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theories
bharath321164
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
High Performance Liquid Chromatography .pptx
High Performance Liquid Chromatography .pptxHigh Performance Liquid Chromatography .pptx
High Performance Liquid Chromatography .pptx
Ayush Srivastava
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Studying Drama: Definition, types and elements
Studying Drama: Definition, types and elementsStudying Drama: Definition, types and elements
Studying Drama: Definition, types and elements
AbdelFattahAdel2
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Timber Pitch Roof Construction Measurement-2024.pptx
Timber Pitch Roof Construction Measurement-2024.pptxTimber Pitch Roof Construction Measurement-2024.pptx
Timber Pitch Roof Construction Measurement-2024.pptx
Tantish QS, UTM
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 

Model Performance Metrics. Accuracy, Precision, Recall

  • 1. Data Science Model Performance Metrics (Accuracy, Precision, Recall)
  • 2. Model Performance Metrics Model performance metrics are measurements used to evaluate the effectiveness and efficiency of a predictive model or machine learning algorithm. To evaluate the performance of predictive model there are metrics: Accuracy Precision Recall (Sensitivity) F1-Score Confusion Matrix ROC Curve and AUC Please check the description box for the link to Machine Learning videos.
  • 3. TP TN FP FN A true positive is an outcome where the model correctly predicts the positive class. Similarly, a true negative is an outcome where the model correctly predicts the negative class. A false positive is an outcome where the model incorrectly predicts the positive class. And a false negative is an outcome where the model incorrectly predicts the negative class. Predicted Positive Negative Positive Negative Actual True Positive TP True Negative TN False Negative FN False Positive FP
  • 4. Accuracy Accuracy: Accuracy is the ratio of the number of correct predictions and the total number of predictions. It is calculated as- Accuracy = (TP + TN) / (TP + TN + FP + FN) Accuracy is useful in binary classification with balanced classes, also be used for evaluating multiclass classification model when classes are balanced. When classes in the dataset are highly imbalanced, meaning there is a significant disparity in the number of instances between classes, accuracy can be misleading. A model may achieve high accuracy by simply predicting the majority class for every instance, ignoring the minority class entirely.
  • 5. Example let's consider a medical diagnosis scenario where we are developing a model to predict whether a patient has a rare disease or not. Suppose we have a dataset of 100 patients, out of which only 2 have the disease. This dataset represents a highly imbalanced scenario. let's say we develop a simple classifier that always predicts that a patient does not have the disease. Despite the high accuracy of 98%, this classifier is not useful because it fails to identify any patients with the disease. It simply predicts that every patient is disease-free. In such cases, evaluation metrics like precision, recall, or F1-score provide more insightful information about the model's performance, especially concerning its ability to correctly identify the minority class (patients with the disease).
  • 6. Precision Precision: Precision is a measure of a model’s performance that tells us how many of the positive predictions made by the model are actually correct. It is calculated as- Precision = TP / (TP + FP) Precision is particularly useful in scenarios where the cost of false positives is high. The importance of precision is in music or video recommendation systems, e-commerce websites, etc. where wrong results could lead to customer churn, and this could be harmful to the business. It gives us insight into the model's ability to avoid false positives, A higher precision indicates fewer false positives.
  • 7. Example • Suppose we have a dataset of 1000 emails, out of which 200 are spam (positive class) and 800 are not spam (negative class). After training our spam detection model, it predicts that 250 emails are spam. • True Positives (TP): 150 (correctly identified spam emails) • False Positives (FP): 100 (non-spam emails incorrectly classified as spam) • Using these numbers, let's calculate precision: • Precision=150/150+100=150/250 =0.6 • So, the precision of the model is 0.6 or 60%. This means that out of all the emails predicted as spam, 60% of them are actually spam.
  • 8. Recall (Sensitivity) Recall: Also known as sensitivity or true positive rate, recall measures the proportion of true positive predictions among all actual positive instances in the dataset. It is calculated as- Recall = TP / (TP + FN). Recall is particularly useful in scenarios where capturing all positive instances is crucial, even if it means accepting a higher rate of false positives. In medical diagnosis, missing a positive instance (false negative) can have severe consequences for the patient's health or even lead to loss of life. High recall ensures that the model identifies as many positive cases as possible, reducing the likelihood of missing critical diagnoses. It gives us insight into the model's ability to avoid false negatives, which are cases where patients with the disease are incorrectly diagnosed as not having it.
  • 9. Example • Suppose we have a dataset of 100 patients who were tested for a specific disease, where 20 patients actually have the disease (positive class), and 80 patients do not have the disease (negative class). • After training our diagnostic model, • True Positives (TP): 15 (patients correctly diagnosed with the disease) • False Positives (FP): 5 (patients incorrectly diagnosed with the disease) • False Negatives (FN): 5 (patients with the disease incorrectly diagnosed as not having the disease) • True Negatives (TN): 75 (patients correctly diagnosed as not having the disease) • Recall= 15/15+5 =15/20 =0.75
  • 10. Precision vs Recall • Precision can be seen as a measure of quality. • Higher precision means that an algorithm returns more relevant results than irrelevant ones. • Precision measures the accuracy of positive predictions. • Precision is important when the cost of false positives is high. (e.g. spam detection). • Recall can be seen as a measure of quantity. • Higher recall means that an algorithm returns most of the relevant results (whether irrelevant ones are also returned). • Recall measures the completeness of positive predictions. • Recall is important when the cost of false negative is high. (e.g. disease diagnosis)
  • 11. Thanks for Watching! Please check the description box for the link to Machine Learning videos.