SlideShare a Scribd company logo
Performance Metrics
Learning Objectives
✦Discuss the need for performance metrics
✦List and analyse the key methods of performance metrics
Need for Performance Metrics
Non Technical Domain
Need for Performance Metrics
Technical Domain
Need for Performance Metrics
✦How do you rank machine learning algorithm?
✦How can you pick one algorithm over the other?
✦How do you measure and compare these
algorithms?
Need for Performance Metrics
✦ Performance metric is the answer to these
questions.
✦It helps measure and compare algorithms.
- Stephen Few
“Numbers have an important story to tell.
They rely on you to give them a voice.”
Performance Metrics
- Stephen Few
“Numbers have an important story to tell.
They rely on you to give them a voice.”
Performance Metrics
Assess Machine Learning Algorithms
Machine learning models are evaluated against your selected performance
metrics
Help evaluate efficiency and accuracy of machine learning models
Key Methods of Performance
Metrics
Confusion Matrix Accuracy
Precision Recall
Specificity F1 Score
Meaning of Confusion Matrix
TP FP
FN TN
Actual
Positives(1) Negatives(0)
Positives(1)
Negatives(0)
Predicted
One of the most intuitive and easiest metrics used to find
correctness and accuracy
Not a performance measure
Almost all performance metrics are based on confusion matrix
Confusion Matrix : Example
Cancer Prediction System
There are different approaches that can
hep the center predict cancer
Okay
Let me introduce you to one of the easiest
matrices that can help you predict whether a
person has cancer, the confusion matrix.
Confusion Matrix : Classification
Problem
How to predict if a person has cancer?
Give a label / class to the target variables:
When a person is diagnosed with cancer
When a person is does not have cancer
1
0
Confusion Matrix : Classification
Problem
TP FP
FN TN
Actual
Positives(1) Negatives(0)
Positives(1)
Negatives(0)
Predicted
Sets of classes are given in both dimensions
Terms of Confusion Matrix
True PositiveTP
True Negative TN
False Negative FN
False PositiveFP
TP FP
FN TN
Actual
Positives(1) Negatives(0)
Positives(1)
Negatives(0)
Predicted
True Positive
True Positive
T
P
T
N
F
N
F
P
True Positives are the cases where the actual
class of the data point is 1 (true) and the
predicted value is also 1 (true).
The case where a person has cancer and the
model classifies the case as cancer positive
comes under true positive.
True Negative
True Negative
T
P
T
N
F
N
F
P
True Negatives are the cases when the actual
class of the data point is 0 (false) and the
predicted is also 0 (false). It is negative
because the class predicted was negative.
The case where a person does not have
cancer and the model classifies the case as
cancer negative comes under true negative.
False Positive
T
P
T
N
F
N
F
P
False positives are the cases when the actual
class of the data point is 0 (false) and the
predicted is 1 (true). It is false because the
model has predicted incorrectly.
The case where a person does not have
cancer and the model classifies the case as
cancer positive comes under false positive.
False Positive
False Negative
False Negative
T
P
T
N
F
N
F
P
• False negatives are the cases when the
actual class of the data point is 1 (true) and
the predicted is 0 (false).
• It is false because the model has predicted
incorrectly.
• It is negative because the class predicted
was negative.
The case where a person has cancer and the
model classifies the case as cancer negative
comes under false negatives.
Minimize False Cases
What should be
minimised?
✦A model is best identified by its accuracy
✦No rules are defined to identify false cases
✦It depends on business requirements and context
of the problem.
Minimize False Negative :
Example
Out of 100
people
Actual cancer
patients = 5
Bad Model
Predicts everyone as non-
cancerous
Accuracy = 95%
When a person who does not have cancer is
classified as cancerous
Missing a cancer patient will be a huge
mistake
Minimize False Positive :
Example
The model needs to classify an email as spam or ham (term used for
genuine email).
Assign a label / class to the target variables:
Email is spam
Email is not spam
1
0
Minimize False Positive :
Example
Incoming mail Model
In case of false positive
Important email as spam
! Business stands a chance to miss
an important communication
An important email marked as
spam is more business critical
than diverting a spam email to
inbox.
Classifies
Accuracy
In classification problems, accuracy is defined
by the total number of correct predictions
made out of all the predictions.
Accuracy : Calculation
TP FP
FN TN
Actual
Positives(1) Negatives(0)
Positives(1)
Negatives(0)
Predicates
Accuracy =
TP + TN
TP + FP + FN + TN
Accuracy : Example
When the target variable
classes in the data are nearly
balanced
When do we use
accuracy?
Accuracy : Example
The machine learning model will
have approximately 97%
accuracy in any new predictions.
Accuracy : Example
5 out of 100 people have cancer
When do you
NOT use
accuracy?
It’s a bad model and predicts every case as
noncancerous
It classifies 95 noncancerous patients correctly and 5
cancerous patients as noncancerous
Accuracy of the model is 95%
When the target variable classes in the data are a
majority of one class
Precision
• Refers to the closeness of two or more
measurements
• Aims at deriving correct proportion of
positive identifications
Precision : Calculation
TP FP
FN TN
Actual
Positives(1) Negatives(0)
Positives(1)
Negatives(0)
Predicates
Precision =
TP
TP + FP
Precision : Example
Its a bad model and predicts every case as cancer
When do we use
precision?
Everyone has been predicted as having cancer
Precision of the model is 5%
5 out of 100 people have cancer
Recall or Sensitivity
Recall or sensitivity measures the proportion of
actual positives and that are correctly identified.
Recall or Sensitivity : Calculation
TP FP
FN TN
Actual
Positives(1) Negatives(0)
Positives(1)
Negatives(0)
Predicates
Recall =
TP
TP + FN
Recall or Sensitivity : Example
Predicts every case as cancer
When do we use
recall?
Recall is 100%
Precision of the model is 5%
5 out of 100 people have cancer
Recall as a Measure
When do we use
precision and
when do we use
recall?
Precision is about being
precise, whereas recall is about
capturing all the cases.
Recall as a Measure
When do we use
precision and
when do we use
recall?
If the model captures one
correct cancer positive case, it is
100% precise.
Recall as a Measure
When do we use
precision and
when do we use
recall?
If the model captures ever case
as cancer positive, you
have100% recall.
Recall as a Measure
When do we use
precision and
when do we use
recall?
To focus on minimising false
negatives you would want 100%
recall with a good precision
score.
Recall as a Measure
When do we use
precision and
when do we use
recall?
To focus on minimising false
positives you should aim for
100% precision.
Specificity
• Measures = proportion of actual negatives
that are correctly identified
• Tries to identify probability of a negative test
result when input with a negative example
Specificity : Calculation
TP FP
FN TN
Actual
Positives(1) Negatives(0)
Positives(1)
Negatives(0)
Predicates
Specificity =
TN
TN + FP
Specificity : Example
Predicts every case as cancer
So specificity is
the exact
opposite of
recall
Specificity is 0%
5 out of 100 people have cancer
F1 Score
Do you have to carry both precision and
recall in your pockets every time you
make a model to solve a classification
problem?
No to avoid taking both precision and
recall, its best to get a single score
(F1 score) that can represent both
precision (P) and recall (R).
F1 Score : Calculation
3 97
0 0
Actual
Fraud Not Fraud
Fraud
Not Fraud
Predicates
F1 Score =
2 * Precision * Recall
Precision + Recall
F1 Score : Example
97 out of 100 credit card transactions are legit and 3 are
fraud
When do you
use F1 score?
Predicts everything as fraud
Fraud detection
F1 Score : Example
Precision =
3
100
= 3%
Recall =
100
3
= 100%
Arithmetic Mean =
3+100
2
= 51.5%
Harmonic Mean
• Harmonic mean is an average used when x
and y are equal
• Value of the mean is smaller when x and y are
different
With reference to the fraud detection example,
F1 Score can be calculated as
F1 Score =
2 * Precision * Recall
Precision + Recall
=
2 * 3 * 100
100 + 3
= 5%
Key Takeaways
✦Confusion matrix is used to find correctness and accusation of machine learning models. It is
also used for classification problems where the output can be one of two or more types of
classes.
✦Accuracy is the number of correct prediction made by the model over all kinds of predictions.
✦Precisision refers to the closeness of two or more measurements to each other
✦Recall measures the proportion of actual positives that are identified correctly.
✦Specificity measures the proportion of actual negatives that are identified correctly.
✦F1 Score gives a single score that represents both precision (P) and recall (R).
✦Harmonic mean is used when the sample data contains extreme value because it is more
balanced than arithmetic mean.

More Related Content

What's hot

Back propagation
Back propagationBack propagation
Back propagation
Nagarajan
 
Log Transformation in Image Processing with Example
Log Transformation in Image Processing with ExampleLog Transformation in Image Processing with Example
Log Transformation in Image Processing with Example
Mustak Ahmmed
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
Sanyam Agarwal
 
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysisFinite automata-for-lexical-analysis
Finite automata-for-lexical-analysis
Dattatray Gandhmal
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
Hema Kashyap
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
Krish Everglades
 
Image processing presentataion
Image processing presentataionImage processing presentataion
Image processing presentataion
Rafi Ullah
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image Processing
Pallavi Agarwal
 
Lecture 3 - Introduction to Interpolation
Lecture 3 - Introduction to InterpolationLecture 3 - Introduction to Interpolation
Lecture 3 - Introduction to Interpolation
Eric Cochran
 
Linear regression with gradient descent
Linear regression with gradient descentLinear regression with gradient descent
Linear regression with gradient descent
Suraj Parmar
 
Emotion detection using cnn.pptx
Emotion detection using cnn.pptxEmotion detection using cnn.pptx
Emotion detection using cnn.pptx
RADO7900
 
Kalman filter for object tracking
Kalman filter for object trackingKalman filter for object tracking
Kalman filter for object tracking
Mohit Yadav
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
Madhu Bala
 
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Edureka!
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
Jothi Lakshmi
 
Autoencoder
AutoencoderAutoencoder
Autoencoder
HARISH R
 
Recursion (left recursion) | Compiler design
Recursion (left recursion) | Compiler designRecursion (left recursion) | Compiler design
Recursion (left recursion) | Compiler design
Shamsul Huda
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
Shivangi Saxena
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
Ahmed Daoud
 
U-Net (1).pptx
U-Net (1).pptxU-Net (1).pptx
U-Net (1).pptx
Changjin Lee
 

What's hot (20)

Back propagation
Back propagationBack propagation
Back propagation
 
Log Transformation in Image Processing with Example
Log Transformation in Image Processing with ExampleLog Transformation in Image Processing with Example
Log Transformation in Image Processing with Example
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Finite automata-for-lexical-analysis
Finite automata-for-lexical-analysisFinite automata-for-lexical-analysis
Finite automata-for-lexical-analysis
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
 
Image processing presentataion
Image processing presentataionImage processing presentataion
Image processing presentataion
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image Processing
 
Lecture 3 - Introduction to Interpolation
Lecture 3 - Introduction to InterpolationLecture 3 - Introduction to Interpolation
Lecture 3 - Introduction to Interpolation
 
Linear regression with gradient descent
Linear regression with gradient descentLinear regression with gradient descent
Linear regression with gradient descent
 
Emotion detection using cnn.pptx
Emotion detection using cnn.pptxEmotion detection using cnn.pptx
Emotion detection using cnn.pptx
 
Kalman filter for object tracking
Kalman filter for object trackingKalman filter for object tracking
Kalman filter for object tracking
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
 
RECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSINGRECURSIVE DESCENT PARSING
RECURSIVE DESCENT PARSING
 
Autoencoder
AutoencoderAutoencoder
Autoencoder
 
Recursion (left recursion) | Compiler design
Recursion (left recursion) | Compiler designRecursion (left recursion) | Compiler design
Recursion (left recursion) | Compiler design
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
U-Net (1).pptx
U-Net (1).pptxU-Net (1).pptx
U-Net (1).pptx
 

Similar to 04 performance metrics v2

Model Evaluation Matrix: Accuracy, precision and recall
Model Evaluation Matrix: Accuracy, precision and recallModel Evaluation Matrix: Accuracy, precision and recall
Model Evaluation Matrix: Accuracy, precision and recall
Megha Sharma
 
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
 
Performance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning AlgorithmsPerformance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning Algorithms
Kush Kulshrestha
 
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
 
Lecture-12Evaluation Measures-ML.pptx
Lecture-12Evaluation Measures-ML.pptxLecture-12Evaluation Measures-ML.pptx
Lecture-12Evaluation Measures-ML.pptx
GauravSonawane51
 
Machine learning session5(logistic regression)
Machine learning   session5(logistic regression)Machine learning   session5(logistic regression)
Machine learning session5(logistic regression)
Abhimanyu Dwivedi
 
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
 
Sensitivity and Specificity in Predictive Modeling
Sensitivity and Specificity in Predictive ModelingSensitivity and Specificity in Predictive Modeling
Sensitivity and Specificity in Predictive Modeling
Sarajit Poddar, GPHR, HRMP
 
ML-ChapterFour-ModelEvaluation.pptx
ML-ChapterFour-ModelEvaluation.pptxML-ChapterFour-ModelEvaluation.pptx
ML-ChapterFour-ModelEvaluation.pptx
belay41
 
What So Funny About Proportion Testv3
What So Funny About Proportion Testv3What So Funny About Proportion Testv3
What So Funny About Proportion Testv3
ChrisConnors
 
DL.f23-lec15.ConfusionMatrix.pptx
DL.f23-lec15.ConfusionMatrix.pptxDL.f23-lec15.ConfusionMatrix.pptx
DL.f23-lec15.ConfusionMatrix.pptx
AyeshaIfkikhar
 
Machine Learning Unit 2 Semester 3 MSc IT Part 2 Mumbai University
Machine Learning Unit 2 Semester 3  MSc IT Part 2 Mumbai UniversityMachine Learning Unit 2 Semester 3  MSc IT Part 2 Mumbai University
Machine Learning Unit 2 Semester 3 MSc IT Part 2 Mumbai University
Madhav Mishra
 
EVALUATION IN AI.pptx
EVALUATION IN AI.pptxEVALUATION IN AI.pptx
EVALUATION IN AI.pptx
Jitendra Kumar Yadav
 
Model selection and cross validation techniques
Model selection and cross validation techniquesModel selection and cross validation techniques
Model selection and cross validation techniques
Venkata Reddy Konasani
 
Statistics
StatisticsStatistics
Statistics
fracpractice
 
Performance Measurement for Machine Leaning.pptx
Performance Measurement for Machine Leaning.pptxPerformance Measurement for Machine Leaning.pptx
Performance Measurement for Machine Leaning.pptx
toneve4907
 
Ways to evaluate a machine learning model’s performance
Ways to evaluate a machine learning model’s performanceWays to evaluate a machine learning model’s performance
Ways to evaluate a machine learning model’s performance
Mala Deep Upadhaya
 
Quantitative critical appraisal october 2015
Quantitative critical appraisal october 2015Quantitative critical appraisal october 2015
Quantitative critical appraisal october 2015
Isla Kuhn
 
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
 

Similar to 04 performance metrics v2 (20)

Model Evaluation Matrix: Accuracy, precision and recall
Model Evaluation Matrix: Accuracy, precision and recallModel Evaluation Matrix: Accuracy, precision and recall
Model Evaluation Matrix: Accuracy, precision and recall
 
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
 
Performance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning AlgorithmsPerformance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning Algorithms
 
Confusion matrix and classification evaluation metrics
Confusion matrix and classification evaluation metricsConfusion matrix and classification evaluation metrics
Confusion matrix and classification evaluation metrics
 
Lecture-12Evaluation Measures-ML.pptx
Lecture-12Evaluation Measures-ML.pptxLecture-12Evaluation Measures-ML.pptx
Lecture-12Evaluation Measures-ML.pptx
 
Machine learning session5(logistic regression)
Machine learning   session5(logistic regression)Machine learning   session5(logistic regression)
Machine learning session5(logistic regression)
 
MACHINE LEARNING PPT K MEANS CLUSTERING.
MACHINE LEARNING PPT K MEANS CLUSTERING.MACHINE LEARNING PPT K MEANS CLUSTERING.
MACHINE LEARNING PPT K MEANS CLUSTERING.
 
Important Classification and Regression Metrics.pptx
Important Classification and Regression Metrics.pptxImportant Classification and Regression Metrics.pptx
Important Classification and Regression Metrics.pptx
 
Sensitivity and Specificity in Predictive Modeling
Sensitivity and Specificity in Predictive ModelingSensitivity and Specificity in Predictive Modeling
Sensitivity and Specificity in Predictive Modeling
 
ML-ChapterFour-ModelEvaluation.pptx
ML-ChapterFour-ModelEvaluation.pptxML-ChapterFour-ModelEvaluation.pptx
ML-ChapterFour-ModelEvaluation.pptx
 
What So Funny About Proportion Testv3
What So Funny About Proportion Testv3What So Funny About Proportion Testv3
What So Funny About Proportion Testv3
 
DL.f23-lec15.ConfusionMatrix.pptx
DL.f23-lec15.ConfusionMatrix.pptxDL.f23-lec15.ConfusionMatrix.pptx
DL.f23-lec15.ConfusionMatrix.pptx
 
Machine Learning Unit 2 Semester 3 MSc IT Part 2 Mumbai University
Machine Learning Unit 2 Semester 3  MSc IT Part 2 Mumbai UniversityMachine Learning Unit 2 Semester 3  MSc IT Part 2 Mumbai University
Machine Learning Unit 2 Semester 3 MSc IT Part 2 Mumbai University
 
EVALUATION IN AI.pptx
EVALUATION IN AI.pptxEVALUATION IN AI.pptx
EVALUATION IN AI.pptx
 
Model selection and cross validation techniques
Model selection and cross validation techniquesModel selection and cross validation techniques
Model selection and cross validation techniques
 
Statistics
StatisticsStatistics
Statistics
 
Performance Measurement for Machine Leaning.pptx
Performance Measurement for Machine Leaning.pptxPerformance Measurement for Machine Leaning.pptx
Performance Measurement for Machine Leaning.pptx
 
Ways to evaluate a machine learning model’s performance
Ways to evaluate a machine learning model’s performanceWays to evaluate a machine learning model’s performance
Ways to evaluate a machine learning model’s performance
 
Quantitative critical appraisal october 2015
Quantitative critical appraisal october 2015Quantitative critical appraisal october 2015
Quantitative critical appraisal october 2015
 
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
 

More from Anne Starr

I01letor20so201leutor2020
I01letor20so201leutor2020I01letor20so201leutor2020
I01letor20so201leutor2020
Anne Starr
 
Iso27001leadauditor2020
Iso27001leadauditor2020Iso27001leadauditor2020
Iso27001leadauditor2020
Anne Starr
 
Ccsddm5days
Ccsddm5daysCcsddm5days
Ccsddm5days
Anne Starr
 
Dayblic
DayblicDayblic
Dayblic
Anne Starr
 
Day1cspbeblic
Day1cspbeblicDay1cspbeblic
Day1cspbeblic
Anne Starr
 
Dncybersecurity
DncybersecurityDncybersecurity
Dncybersecurity
Anne Starr
 
Dancyrityshy 1foundatioieh
Dancyrityshy 1foundatioiehDancyrityshy 1foundatioieh
Dancyrityshy 1foundatioieh
Anne Starr
 
2 slides(2ndvariadaystion)
2 slides(2ndvariadaystion)2 slides(2ndvariadaystion)
2 slides(2ndvariadaystion)
Anne Starr
 
Sec4
Sec4Sec4
Secuntialesse
SecuntialesseSecuntialesse
Secuntialesse
Anne Starr
 
Securityic2
Securityic2Securityic2
Securityic2
Anne Starr
 
)k
)k)k
inte
inteinte
Awtitioneressentialsdeckscloudprac401-577
Awtitioneressentialsdeckscloudprac401-577Awtitioneressentialsdeckscloudprac401-577
Awtitioneressentialsdeckscloudprac401-577
Anne Starr
 
01wslouAsentialsdeck2dpractitioneres-400
01wslouAsentialsdeck2dpractitioneres-40001wslouAsentialsdeck2dpractitioneres-400
01wslouAsentialsdeck2dpractitioneres-400
Anne Starr
 
uderessAwscloentialsdeck1-2ion00
uderessAwscloentialsdeck1-2ion00uderessAwscloentialsdeck1-2ion00
uderessAwscloentialsdeck1-2ion00
Anne Starr
 
Cloudhnologysstecociat
CloudhnologysstecociatCloudhnologysstecociat
Cloudhnologysstecociat
Anne Starr
 
Cmbysantocsddsh
CmbysantocsddshCmbysantocsddsh
Cmbysantocsddsh
Anne Starr
 
Cddmbysantcsosh
CddmbysantcsoshCddmbysantcsosh
Cddmbysantcsosh
Anne Starr
 
Ccbysantsddosh
Ccbysantsddosh  Ccbysantsddosh
Ccbysantsddosh
Anne Starr
 

More from Anne Starr (20)

I01letor20so201leutor2020
I01letor20so201leutor2020I01letor20so201leutor2020
I01letor20so201leutor2020
 
Iso27001leadauditor2020
Iso27001leadauditor2020Iso27001leadauditor2020
Iso27001leadauditor2020
 
Ccsddm5days
Ccsddm5daysCcsddm5days
Ccsddm5days
 
Dayblic
DayblicDayblic
Dayblic
 
Day1cspbeblic
Day1cspbeblicDay1cspbeblic
Day1cspbeblic
 
Dncybersecurity
DncybersecurityDncybersecurity
Dncybersecurity
 
Dancyrityshy 1foundatioieh
Dancyrityshy 1foundatioiehDancyrityshy 1foundatioieh
Dancyrityshy 1foundatioieh
 
2 slides(2ndvariadaystion)
2 slides(2ndvariadaystion)2 slides(2ndvariadaystion)
2 slides(2ndvariadaystion)
 
Sec4
Sec4Sec4
Sec4
 
Secuntialesse
SecuntialesseSecuntialesse
Secuntialesse
 
Securityic2
Securityic2Securityic2
Securityic2
 
)k
)k)k
)k
 
inte
inteinte
inte
 
Awtitioneressentialsdeckscloudprac401-577
Awtitioneressentialsdeckscloudprac401-577Awtitioneressentialsdeckscloudprac401-577
Awtitioneressentialsdeckscloudprac401-577
 
01wslouAsentialsdeck2dpractitioneres-400
01wslouAsentialsdeck2dpractitioneres-40001wslouAsentialsdeck2dpractitioneres-400
01wslouAsentialsdeck2dpractitioneres-400
 
uderessAwscloentialsdeck1-2ion00
uderessAwscloentialsdeck1-2ion00uderessAwscloentialsdeck1-2ion00
uderessAwscloentialsdeck1-2ion00
 
Cloudhnologysstecociat
CloudhnologysstecociatCloudhnologysstecociat
Cloudhnologysstecociat
 
Cmbysantocsddsh
CmbysantocsddshCmbysantocsddsh
Cmbysantocsddsh
 
Cddmbysantcsosh
CddmbysantcsoshCddmbysantcsosh
Cddmbysantcsosh
 
Ccbysantsddosh
Ccbysantsddosh  Ccbysantsddosh
Ccbysantsddosh
 

Recently uploaded

writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 

Recently uploaded (20)

writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 

04 performance metrics v2

  • 2. Learning Objectives ✦Discuss the need for performance metrics ✦List and analyse the key methods of performance metrics
  • 3. Need for Performance Metrics Non Technical Domain
  • 4. Need for Performance Metrics Technical Domain
  • 5. Need for Performance Metrics ✦How do you rank machine learning algorithm? ✦How can you pick one algorithm over the other? ✦How do you measure and compare these algorithms?
  • 6. Need for Performance Metrics ✦ Performance metric is the answer to these questions. ✦It helps measure and compare algorithms.
  • 7. - Stephen Few “Numbers have an important story to tell. They rely on you to give them a voice.” Performance Metrics
  • 8. - Stephen Few “Numbers have an important story to tell. They rely on you to give them a voice.” Performance Metrics Assess Machine Learning Algorithms Machine learning models are evaluated against your selected performance metrics Help evaluate efficiency and accuracy of machine learning models
  • 9. Key Methods of Performance Metrics Confusion Matrix Accuracy Precision Recall Specificity F1 Score
  • 10. Meaning of Confusion Matrix TP FP FN TN Actual Positives(1) Negatives(0) Positives(1) Negatives(0) Predicted One of the most intuitive and easiest metrics used to find correctness and accuracy Not a performance measure Almost all performance metrics are based on confusion matrix
  • 11. Confusion Matrix : Example Cancer Prediction System There are different approaches that can hep the center predict cancer Okay Let me introduce you to one of the easiest matrices that can help you predict whether a person has cancer, the confusion matrix.
  • 12. Confusion Matrix : Classification Problem How to predict if a person has cancer? Give a label / class to the target variables: When a person is diagnosed with cancer When a person is does not have cancer 1 0
  • 13. Confusion Matrix : Classification Problem TP FP FN TN Actual Positives(1) Negatives(0) Positives(1) Negatives(0) Predicted Sets of classes are given in both dimensions
  • 14. Terms of Confusion Matrix True PositiveTP True Negative TN False Negative FN False PositiveFP TP FP FN TN Actual Positives(1) Negatives(0) Positives(1) Negatives(0) Predicted
  • 15. True Positive True Positive T P T N F N F P True Positives are the cases where the actual class of the data point is 1 (true) and the predicted value is also 1 (true). The case where a person has cancer and the model classifies the case as cancer positive comes under true positive.
  • 16. True Negative True Negative T P T N F N F P True Negatives are the cases when the actual class of the data point is 0 (false) and the predicted is also 0 (false). It is negative because the class predicted was negative. The case where a person does not have cancer and the model classifies the case as cancer negative comes under true negative.
  • 17. False Positive T P T N F N F P False positives are the cases when the actual class of the data point is 0 (false) and the predicted is 1 (true). It is false because the model has predicted incorrectly. The case where a person does not have cancer and the model classifies the case as cancer positive comes under false positive. False Positive
  • 18. False Negative False Negative T P T N F N F P • False negatives are the cases when the actual class of the data point is 1 (true) and the predicted is 0 (false). • It is false because the model has predicted incorrectly. • It is negative because the class predicted was negative. The case where a person has cancer and the model classifies the case as cancer negative comes under false negatives.
  • 19. Minimize False Cases What should be minimised? ✦A model is best identified by its accuracy ✦No rules are defined to identify false cases ✦It depends on business requirements and context of the problem.
  • 20. Minimize False Negative : Example Out of 100 people Actual cancer patients = 5 Bad Model Predicts everyone as non- cancerous Accuracy = 95% When a person who does not have cancer is classified as cancerous Missing a cancer patient will be a huge mistake
  • 21. Minimize False Positive : Example The model needs to classify an email as spam or ham (term used for genuine email). Assign a label / class to the target variables: Email is spam Email is not spam 1 0
  • 22. Minimize False Positive : Example Incoming mail Model In case of false positive Important email as spam ! Business stands a chance to miss an important communication An important email marked as spam is more business critical than diverting a spam email to inbox. Classifies
  • 23. Accuracy In classification problems, accuracy is defined by the total number of correct predictions made out of all the predictions.
  • 24. Accuracy : Calculation TP FP FN TN Actual Positives(1) Negatives(0) Positives(1) Negatives(0) Predicates Accuracy = TP + TN TP + FP + FN + TN
  • 25. Accuracy : Example When the target variable classes in the data are nearly balanced When do we use accuracy?
  • 26. Accuracy : Example The machine learning model will have approximately 97% accuracy in any new predictions.
  • 27. Accuracy : Example 5 out of 100 people have cancer When do you NOT use accuracy? It’s a bad model and predicts every case as noncancerous It classifies 95 noncancerous patients correctly and 5 cancerous patients as noncancerous Accuracy of the model is 95% When the target variable classes in the data are a majority of one class
  • 28. Precision • Refers to the closeness of two or more measurements • Aims at deriving correct proportion of positive identifications
  • 29. Precision : Calculation TP FP FN TN Actual Positives(1) Negatives(0) Positives(1) Negatives(0) Predicates Precision = TP TP + FP
  • 30. Precision : Example Its a bad model and predicts every case as cancer When do we use precision? Everyone has been predicted as having cancer Precision of the model is 5% 5 out of 100 people have cancer
  • 31. Recall or Sensitivity Recall or sensitivity measures the proportion of actual positives and that are correctly identified.
  • 32. Recall or Sensitivity : Calculation TP FP FN TN Actual Positives(1) Negatives(0) Positives(1) Negatives(0) Predicates Recall = TP TP + FN
  • 33. Recall or Sensitivity : Example Predicts every case as cancer When do we use recall? Recall is 100% Precision of the model is 5% 5 out of 100 people have cancer
  • 34. Recall as a Measure When do we use precision and when do we use recall? Precision is about being precise, whereas recall is about capturing all the cases.
  • 35. Recall as a Measure When do we use precision and when do we use recall? If the model captures one correct cancer positive case, it is 100% precise.
  • 36. Recall as a Measure When do we use precision and when do we use recall? If the model captures ever case as cancer positive, you have100% recall.
  • 37. Recall as a Measure When do we use precision and when do we use recall? To focus on minimising false negatives you would want 100% recall with a good precision score.
  • 38. Recall as a Measure When do we use precision and when do we use recall? To focus on minimising false positives you should aim for 100% precision.
  • 39. Specificity • Measures = proportion of actual negatives that are correctly identified • Tries to identify probability of a negative test result when input with a negative example
  • 40. Specificity : Calculation TP FP FN TN Actual Positives(1) Negatives(0) Positives(1) Negatives(0) Predicates Specificity = TN TN + FP
  • 41. Specificity : Example Predicts every case as cancer So specificity is the exact opposite of recall Specificity is 0% 5 out of 100 people have cancer
  • 42. F1 Score Do you have to carry both precision and recall in your pockets every time you make a model to solve a classification problem? No to avoid taking both precision and recall, its best to get a single score (F1 score) that can represent both precision (P) and recall (R).
  • 43. F1 Score : Calculation 3 97 0 0 Actual Fraud Not Fraud Fraud Not Fraud Predicates F1 Score = 2 * Precision * Recall Precision + Recall
  • 44. F1 Score : Example 97 out of 100 credit card transactions are legit and 3 are fraud When do you use F1 score? Predicts everything as fraud Fraud detection
  • 45. F1 Score : Example Precision = 3 100 = 3% Recall = 100 3 = 100% Arithmetic Mean = 3+100 2 = 51.5%
  • 46. Harmonic Mean • Harmonic mean is an average used when x and y are equal • Value of the mean is smaller when x and y are different With reference to the fraud detection example, F1 Score can be calculated as F1 Score = 2 * Precision * Recall Precision + Recall = 2 * 3 * 100 100 + 3 = 5%
  • 47. Key Takeaways ✦Confusion matrix is used to find correctness and accusation of machine learning models. It is also used for classification problems where the output can be one of two or more types of classes. ✦Accuracy is the number of correct prediction made by the model over all kinds of predictions. ✦Precisision refers to the closeness of two or more measurements to each other ✦Recall measures the proportion of actual positives that are identified correctly. ✦Specificity measures the proportion of actual negatives that are identified correctly. ✦F1 Score gives a single score that represents both precision (P) and recall (R). ✦Harmonic mean is used when the sample data contains extreme value because it is more balanced than arithmetic mean.

Editor's Notes

  1. So many algorithms around. How do you decide which is best?
  2. Cancer research
  3. No model is 100% accurate and therefore to be closer to accurate we have to minimise the errors in false cases