SlideShare a Scribd company logo
1 of 13
Confusion Matrix
1
Confusion Matrix
๏‚ด A confusion matrix for a two classes (+, -) is shown below.
๏‚ด There are four quadrants in the confusion matrix, which are symbolized as
below.
๏‚ด True Positive (TP: f++) : The number of instances that were positive (+) and
correctly classified as positive (+).
๏‚ด False Negative (FN: f+-): The number of instances that were positive (+) and
incorrectly classified as negative (-).
๏‚ด False Positive (FP: f-+): The number of instances that were negative (-) and
incorrectly classified as (+).
๏‚ด True Negative (TN: f--): The number of instances that were negative (-) and
correctly classified as (-).
2
Confusion Matrix
Note:
๏‚ด Np = TP (f++) + FN (f+-)
= is the total number of positive instances.
๏‚ด Nn = FP(f-+) + Tn(f--)
= is the total number of negative instances.
๏‚ด N = Np + Nn
= is the total number of instances.
๏‚ด (TP + TN) denotes the number of correct classification
๏‚ด (FP + FN) denotes the number of errors in classification.
๏‚ด For a perfect classifier, FP = FN = 0
3
Confusion Matrix Example
๏‚ด For example,
Calculate the performance evaluation metrics
4
Class + -
+ 52 (TP) 18 (FN)
- 21 (FP) 123 (TN)
Accuracy
๏‚ด It is defined as the fraction of the number of examples that are correctly
classified by the classifier to the total number of instances.
Accuracy=
๐‘‡๐‘ƒ+๐‘‡๐‘
๐‘‡๐‘ƒ+๐น๐‘ƒ+๐น๐‘+๐‘‡๐‘
5
Performance Evaluation Metrics
๏‚ด We now define a number of metrics for the measurement of a classifier.
๏‚ด In our discussion, we shall make the assumptions that there are only two classes:
+ (positive) and โ€“ (negative)
๏‚ด True Positive Rate (TPR): It is defined as the fraction of the positive
examples predicted correctly by the classifier.
๐‘‡๐‘ƒ๐‘… =
๐‘‡๐‘ƒ
๐‘ƒ
=
๐‘‡๐‘ƒ
๐‘‡๐‘ƒ+๐น๐‘
=
๐‘“++
๐‘“+++๐‘“+โˆ’
๏‚ด This metrics is also known as Recall, Sensitivity or Hit rate.
๏‚ด False Positive Rate (FPR): It is defined as the fraction of negative examples
classified as positive class by the classifier.
๐น๐‘ƒ๐‘… =
๐น๐‘ƒ
๐‘
=
๐น๐‘ƒ
๐น๐‘ƒ + ๐‘‡๐‘
=
๐‘“ โˆ’ +
๐‘“ โˆ’+
+๐‘“โˆ’โˆ’
6
Performance Evaluation Metrics
๏‚ด False Negative Rate (FNR): It is defined as the fraction of positive
examples classified as a negative class by the classifier.
๐น๐‘๐‘… =
๐น๐‘
๐‘ƒ
=
๐น๐‘
๐‘‡๐‘ƒ + ๐น๐‘
=
๐‘“+โˆ’
๐‘“++ + ๐‘“+โˆ’
๏‚ด True Negative Rate (TNR): It is defined as the fraction of negative
examples classified correctly by the classifier
๐‘‡๐‘๐‘… =
๐‘‡๐‘
๐‘
=
๐‘‡๐‘
๐‘‡๐‘ + ๐น๐‘ƒ
=
๐‘“โˆ’โˆ’
๐‘“โˆ’โˆ’ + ๐‘“ โˆ’ +
๏‚ด This metric is also known as Specificity.
7
Performance Evaluation Metrics
๏‚ด Both, Precision and Recall are defined by
๐‘ƒ๐‘Ÿ๐‘’๐‘๐‘–๐‘ ๐‘–๐‘œ๐‘› =
๐‘‡๐‘ƒ
๐‘‡๐‘ƒ + ๐น๐‘ƒ
๐‘…๐‘’๐‘๐‘Ž๐‘™๐‘™ =
๐‘‡๐‘ƒ
๐‘‡๐‘ƒ + ๐น๐‘
8
Performance Evaluation Metrics
9
๏‚— F1 Score (F1): Recall (r) and Precision (p) are two
widely used metrics employed in analysis..
๏‚— It is defined in terms of (r or Recall) and (p or
Precision) as follows.
๐น1๐‘†๐‘๐‘œ๐‘Ÿ๐‘’ =
2 โˆ— ๐‘…๐‘’๐‘๐‘Ž๐‘™๐‘™ . ๐‘ƒ๐‘Ÿ๐‘’๐‘๐‘–๐‘ ๐‘–๐‘œ๐‘›
๐‘…๐‘’๐‘๐‘Ž๐‘™๐‘™ + ๐‘ƒ๐‘Ÿ๐‘’๐‘๐‘–๐‘ ๐‘–๐‘œ๐‘›
=
2๐‘‡๐‘ƒ
2๐‘‡๐‘ƒ + ๐น๐‘ƒ + ๐น๐‘
Note
๏‚— F1 represents the harmonic mean between recall and
precision
๏‚— High value of F1 score ensures that both Precision and
Recall are reasonably high.
Analysis with Performance Measurement Metrics
๏‚ด Based on the various performance metrics, we can characterize a classifier.
๏‚ด We do it in terms of TPR, FPR, Precision and Recall and Accuracy
๏‚ด Case 1: Perfect Classifier
When every instance is correctly classified, it is called the perfect classifier. In this
case, TP = P, TN = N and CM is
TPR = TP/(TP+FN)=
๐‘ƒ
๐‘ƒ
=1
FPR =
0
๐‘
=0
Precision =
๐‘ƒ
๐‘ƒ
= 1
F1 Score =
2ร—1
1+1
= 1
Accuracy =
๐‘ƒ+๐‘
๐‘ƒ+๐‘
= 1
10
Predicted Class
+ -
Actual
class + P 0
- 0 N
Analysis with Performance Measurement Metrics
๏‚ด Case 2: Worst Classifier
When every instance is wrongly classified, it is called the worst classifier. In this
case, TP = 0, TN = 0 and the CM is
TPR =
0
๐‘ƒ
=0
FPR =
๐‘
๐‘
= 1
Precision =
0
๐‘
= 0
F1 Score = Not applicable
as Recall + Precision = 0
Accuracy =
0
๐‘ƒ+๐‘
= 0
11
Predicted Class
+ -
Actual
class
+ 0 P
- N 0
Analysis with Performance Measurement Metrics
๏‚ด Case 3: Ultra-Liberal Classifier
The classifier always predicts the + class correctly. Here, the False Negative
(FN) and True Negative (TN) are zero. The CM is
TPR =
๐‘ƒ
๐‘ƒ
= 1
FPR =
๐‘
๐‘
= 1
Precision =
๐‘ƒ
๐‘ƒ+๐‘
F1 Score =
2๐‘ƒ
2๐‘ƒ+๐‘
Accuracy =
๐‘ƒ
๐‘ƒ+๐‘
= 0
12
Predicted Class
+ -
Actual
class
+ P 0
- N 0
Analysis with Performance Measurement Metrics
๏‚ด Case 4: Ultra-Conservative Classifier
This classifier always predicts the - class correctly. Here, the False Negative
(FN) and True Negative (TN) are zero. The CM is
TPR =
0
๐‘ƒ
= 0
FPR =
0
๐‘
= 0
Precision = Not applicable
(as TP + FP = 0)
F1 Score = Not applicable
Accuracy =
๐‘
๐‘ƒ+๐‘
= 0
13
Predicted Class
+ -
Actual
class
+ 0 p
- 0 N

More Related Content

Similar to Confusion Matrix.pptx

Machine learning session5(logistic regression)
Machine learning   session5(logistic regression)Machine learning   session5(logistic regression)
Machine learning session5(logistic regression)Abhimanyu Dwivedi
ย 
Machine Learning Performance metrics for classification
Machine Learning Performance metrics for classificationMachine Learning Performance metrics for classification
Machine Learning Performance metrics for classificationKuppusamy P
ย 
MLA_Confusion Matrix for Classification
MLA_Confusion Matrix for ClassificationMLA_Confusion Matrix for Classification
MLA_Confusion Matrix for ClassificationShruti Chaudhari
ย 
Evaluation metrics for binary classification - the ultimate guide
Evaluation metrics for binary classification - the ultimate guideEvaluation metrics for binary classification - the ultimate guide
Evaluation metrics for binary classification - the ultimate guideneptune.ml
ย 
MODEL EVALUATION.pptx
MODEL  EVALUATION.pptxMODEL  EVALUATION.pptx
MODEL EVALUATION.pptxKARPAGAMT3
ย 
Common evaluation measures in NLP and IR
Common evaluation measures in NLP and IRCommon evaluation measures in NLP and IR
Common evaluation measures in NLP and IRRushdi Shams
ย 
section11_Nonparametric.ppt
section11_Nonparametric.pptsection11_Nonparametric.ppt
section11_Nonparametric.pptssuser44b4b7
ย 
Machine learning by Dr. Vivek Vijay and Dr. Sandeep Yadav
Machine learning by Dr. Vivek Vijay and Dr. Sandeep YadavMachine learning by Dr. Vivek Vijay and Dr. Sandeep Yadav
Machine learning by Dr. Vivek Vijay and Dr. Sandeep YadavAgile Testing Alliance
ย 
ML-ChapterFour-ModelEvaluation.pptx
ML-ChapterFour-ModelEvaluation.pptxML-ChapterFour-ModelEvaluation.pptx
ML-ChapterFour-ModelEvaluation.pptxbelay41
ย 

Similar to Confusion Matrix.pptx (10)

Machine learning session5(logistic regression)
Machine learning   session5(logistic regression)Machine learning   session5(logistic regression)
Machine learning session5(logistic regression)
ย 
Machine Learning Performance metrics for classification
Machine Learning Performance metrics for classificationMachine Learning Performance metrics for classification
Machine Learning Performance metrics for classification
ย 
MLA_Confusion Matrix for Classification
MLA_Confusion Matrix for ClassificationMLA_Confusion Matrix for Classification
MLA_Confusion Matrix for Classification
ย 
Evaluation metrics for binary classification - the ultimate guide
Evaluation metrics for binary classification - the ultimate guideEvaluation metrics for binary classification - the ultimate guide
Evaluation metrics for binary classification - the ultimate guide
ย 
MODEL EVALUATION.pptx
MODEL  EVALUATION.pptxMODEL  EVALUATION.pptx
MODEL EVALUATION.pptx
ย 
Deep Learning for Computer Vision: Image Classification (UPC 2016)
Deep Learning for Computer Vision: Image Classification (UPC 2016)Deep Learning for Computer Vision: Image Classification (UPC 2016)
Deep Learning for Computer Vision: Image Classification (UPC 2016)
ย 
Common evaluation measures in NLP and IR
Common evaluation measures in NLP and IRCommon evaluation measures in NLP and IR
Common evaluation measures in NLP and IR
ย 
section11_Nonparametric.ppt
section11_Nonparametric.pptsection11_Nonparametric.ppt
section11_Nonparametric.ppt
ย 
Machine learning by Dr. Vivek Vijay and Dr. Sandeep Yadav
Machine learning by Dr. Vivek Vijay and Dr. Sandeep YadavMachine learning by Dr. Vivek Vijay and Dr. Sandeep Yadav
Machine learning by Dr. Vivek Vijay and Dr. Sandeep Yadav
ย 
ML-ChapterFour-ModelEvaluation.pptx
ML-ChapterFour-ModelEvaluation.pptxML-ChapterFour-ModelEvaluation.pptx
ML-ChapterFour-ModelEvaluation.pptx
ย 

More from Rahul Borate

PigHive presentation and hive impor.pptx
PigHive presentation and hive impor.pptxPigHive presentation and hive impor.pptx
PigHive presentation and hive impor.pptxRahul Borate
ย 
Unit 4_Introduction to Server Farms.pptx
Unit 4_Introduction to Server Farms.pptxUnit 4_Introduction to Server Farms.pptx
Unit 4_Introduction to Server Farms.pptxRahul Borate
ย 
Unit 3_Data Center Design in storage.pptx
Unit  3_Data Center Design in storage.pptxUnit  3_Data Center Design in storage.pptx
Unit 3_Data Center Design in storage.pptxRahul Borate
ย 
Fundamentals of storage Unit III Backup and Recovery.ppt
Fundamentals of storage Unit III Backup and Recovery.pptFundamentals of storage Unit III Backup and Recovery.ppt
Fundamentals of storage Unit III Backup and Recovery.pptRahul Borate
ย 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxRahul Borate
ย 
Unit 4 SVM and AVR.ppt
Unit 4 SVM and AVR.pptUnit 4 SVM and AVR.ppt
Unit 4 SVM and AVR.pptRahul Borate
ย 
Unit I Fundamentals of Cloud Computing.pptx
Unit I Fundamentals of Cloud Computing.pptxUnit I Fundamentals of Cloud Computing.pptx
Unit I Fundamentals of Cloud Computing.pptxRahul Borate
ย 
Unit II Cloud Delivery Models.pptx
Unit II Cloud Delivery Models.pptxUnit II Cloud Delivery Models.pptx
Unit II Cloud Delivery Models.pptxRahul Borate
ย 
QQ Plot.pptx
QQ Plot.pptxQQ Plot.pptx
QQ Plot.pptxRahul Borate
ย 
Module III MachineLearningSparkML.pptx
Module III MachineLearningSparkML.pptxModule III MachineLearningSparkML.pptx
Module III MachineLearningSparkML.pptxRahul Borate
ย 
Unit II Real Time Data Processing tools.pptx
Unit II Real Time Data Processing tools.pptxUnit II Real Time Data Processing tools.pptx
Unit II Real Time Data Processing tools.pptxRahul Borate
ย 
2.2 Logit and Probit.pptx
2.2 Logit and Probit.pptx2.2 Logit and Probit.pptx
2.2 Logit and Probit.pptxRahul Borate
ย 
UNIT I Streaming Data & Architectures.pptx
UNIT I Streaming Data & Architectures.pptxUNIT I Streaming Data & Architectures.pptx
UNIT I Streaming Data & Architectures.pptxRahul Borate
ย 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxRahul Borate
ย 
Practice_Exercises_Files_and_Exceptions.pptx
Practice_Exercises_Files_and_Exceptions.pptxPractice_Exercises_Files_and_Exceptions.pptx
Practice_Exercises_Files_and_Exceptions.pptxRahul Borate
ย 
Practice_Exercises_Data_Structures.pptx
Practice_Exercises_Data_Structures.pptxPractice_Exercises_Data_Structures.pptx
Practice_Exercises_Data_Structures.pptxRahul Borate
ย 
Practice_Exercises_Control_Flow.pptx
Practice_Exercises_Control_Flow.pptxPractice_Exercises_Control_Flow.pptx
Practice_Exercises_Control_Flow.pptxRahul Borate
ย 
blog creation.pdf
blog creation.pdfblog creation.pdf
blog creation.pdfRahul Borate
ย 
Chapter I.pptx
Chapter I.pptxChapter I.pptx
Chapter I.pptxRahul Borate
ย 

More from Rahul Borate (20)

PigHive presentation and hive impor.pptx
PigHive presentation and hive impor.pptxPigHive presentation and hive impor.pptx
PigHive presentation and hive impor.pptx
ย 
Unit 4_Introduction to Server Farms.pptx
Unit 4_Introduction to Server Farms.pptxUnit 4_Introduction to Server Farms.pptx
Unit 4_Introduction to Server Farms.pptx
ย 
Unit 3_Data Center Design in storage.pptx
Unit  3_Data Center Design in storage.pptxUnit  3_Data Center Design in storage.pptx
Unit 3_Data Center Design in storage.pptx
ย 
Fundamentals of storage Unit III Backup and Recovery.ppt
Fundamentals of storage Unit III Backup and Recovery.pptFundamentals of storage Unit III Backup and Recovery.ppt
Fundamentals of storage Unit III Backup and Recovery.ppt
ย 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
ย 
Unit 4 SVM and AVR.ppt
Unit 4 SVM and AVR.pptUnit 4 SVM and AVR.ppt
Unit 4 SVM and AVR.ppt
ย 
Unit I Fundamentals of Cloud Computing.pptx
Unit I Fundamentals of Cloud Computing.pptxUnit I Fundamentals of Cloud Computing.pptx
Unit I Fundamentals of Cloud Computing.pptx
ย 
Unit II Cloud Delivery Models.pptx
Unit II Cloud Delivery Models.pptxUnit II Cloud Delivery Models.pptx
Unit II Cloud Delivery Models.pptx
ย 
QQ Plot.pptx
QQ Plot.pptxQQ Plot.pptx
QQ Plot.pptx
ย 
EDA.pptx
EDA.pptxEDA.pptx
EDA.pptx
ย 
Module III MachineLearningSparkML.pptx
Module III MachineLearningSparkML.pptxModule III MachineLearningSparkML.pptx
Module III MachineLearningSparkML.pptx
ย 
Unit II Real Time Data Processing tools.pptx
Unit II Real Time Data Processing tools.pptxUnit II Real Time Data Processing tools.pptx
Unit II Real Time Data Processing tools.pptx
ย 
2.2 Logit and Probit.pptx
2.2 Logit and Probit.pptx2.2 Logit and Probit.pptx
2.2 Logit and Probit.pptx
ย 
UNIT I Streaming Data & Architectures.pptx
UNIT I Streaming Data & Architectures.pptxUNIT I Streaming Data & Architectures.pptx
UNIT I Streaming Data & Architectures.pptx
ย 
UNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptxUNIT I Introduction to NoSQL.pptx
UNIT I Introduction to NoSQL.pptx
ย 
Practice_Exercises_Files_and_Exceptions.pptx
Practice_Exercises_Files_and_Exceptions.pptxPractice_Exercises_Files_and_Exceptions.pptx
Practice_Exercises_Files_and_Exceptions.pptx
ย 
Practice_Exercises_Data_Structures.pptx
Practice_Exercises_Data_Structures.pptxPractice_Exercises_Data_Structures.pptx
Practice_Exercises_Data_Structures.pptx
ย 
Practice_Exercises_Control_Flow.pptx
Practice_Exercises_Control_Flow.pptxPractice_Exercises_Control_Flow.pptx
Practice_Exercises_Control_Flow.pptx
ย 
blog creation.pdf
blog creation.pdfblog creation.pdf
blog creation.pdf
ย 
Chapter I.pptx
Chapter I.pptxChapter I.pptx
Chapter I.pptx
ย 

Recently uploaded

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
ย 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .DerechoLaboralIndivi
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Standamitlee9823
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
ย 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
ย 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
ย 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
ย 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
ย 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
ย 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
ย 

Recently uploaded (20)

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
ย 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
ย 
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night StandCall Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
Call Girls In Bangalore โ˜Ž 7737669865 ๐Ÿฅต Book Your One night Stand
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
ย 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
ย 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
ย 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
ย 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
ย 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
ย 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ย 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ย 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
ย 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
ย 

Confusion Matrix.pptx

  • 2. Confusion Matrix ๏‚ด A confusion matrix for a two classes (+, -) is shown below. ๏‚ด There are four quadrants in the confusion matrix, which are symbolized as below. ๏‚ด True Positive (TP: f++) : The number of instances that were positive (+) and correctly classified as positive (+). ๏‚ด False Negative (FN: f+-): The number of instances that were positive (+) and incorrectly classified as negative (-). ๏‚ด False Positive (FP: f-+): The number of instances that were negative (-) and incorrectly classified as (+). ๏‚ด True Negative (TN: f--): The number of instances that were negative (-) and correctly classified as (-). 2
  • 3. Confusion Matrix Note: ๏‚ด Np = TP (f++) + FN (f+-) = is the total number of positive instances. ๏‚ด Nn = FP(f-+) + Tn(f--) = is the total number of negative instances. ๏‚ด N = Np + Nn = is the total number of instances. ๏‚ด (TP + TN) denotes the number of correct classification ๏‚ด (FP + FN) denotes the number of errors in classification. ๏‚ด For a perfect classifier, FP = FN = 0 3
  • 4. Confusion Matrix Example ๏‚ด For example, Calculate the performance evaluation metrics 4 Class + - + 52 (TP) 18 (FN) - 21 (FP) 123 (TN)
  • 5. Accuracy ๏‚ด It is defined as the fraction of the number of examples that are correctly classified by the classifier to the total number of instances. Accuracy= ๐‘‡๐‘ƒ+๐‘‡๐‘ ๐‘‡๐‘ƒ+๐น๐‘ƒ+๐น๐‘+๐‘‡๐‘ 5
  • 6. Performance Evaluation Metrics ๏‚ด We now define a number of metrics for the measurement of a classifier. ๏‚ด In our discussion, we shall make the assumptions that there are only two classes: + (positive) and โ€“ (negative) ๏‚ด True Positive Rate (TPR): It is defined as the fraction of the positive examples predicted correctly by the classifier. ๐‘‡๐‘ƒ๐‘… = ๐‘‡๐‘ƒ ๐‘ƒ = ๐‘‡๐‘ƒ ๐‘‡๐‘ƒ+๐น๐‘ = ๐‘“++ ๐‘“+++๐‘“+โˆ’ ๏‚ด This metrics is also known as Recall, Sensitivity or Hit rate. ๏‚ด False Positive Rate (FPR): It is defined as the fraction of negative examples classified as positive class by the classifier. ๐น๐‘ƒ๐‘… = ๐น๐‘ƒ ๐‘ = ๐น๐‘ƒ ๐น๐‘ƒ + ๐‘‡๐‘ = ๐‘“ โˆ’ + ๐‘“ โˆ’+ +๐‘“โˆ’โˆ’ 6
  • 7. Performance Evaluation Metrics ๏‚ด False Negative Rate (FNR): It is defined as the fraction of positive examples classified as a negative class by the classifier. ๐น๐‘๐‘… = ๐น๐‘ ๐‘ƒ = ๐น๐‘ ๐‘‡๐‘ƒ + ๐น๐‘ = ๐‘“+โˆ’ ๐‘“++ + ๐‘“+โˆ’ ๏‚ด True Negative Rate (TNR): It is defined as the fraction of negative examples classified correctly by the classifier ๐‘‡๐‘๐‘… = ๐‘‡๐‘ ๐‘ = ๐‘‡๐‘ ๐‘‡๐‘ + ๐น๐‘ƒ = ๐‘“โˆ’โˆ’ ๐‘“โˆ’โˆ’ + ๐‘“ โˆ’ + ๏‚ด This metric is also known as Specificity. 7
  • 8. Performance Evaluation Metrics ๏‚ด Both, Precision and Recall are defined by ๐‘ƒ๐‘Ÿ๐‘’๐‘๐‘–๐‘ ๐‘–๐‘œ๐‘› = ๐‘‡๐‘ƒ ๐‘‡๐‘ƒ + ๐น๐‘ƒ ๐‘…๐‘’๐‘๐‘Ž๐‘™๐‘™ = ๐‘‡๐‘ƒ ๐‘‡๐‘ƒ + ๐น๐‘ 8
  • 9. Performance Evaluation Metrics 9 ๏‚— F1 Score (F1): Recall (r) and Precision (p) are two widely used metrics employed in analysis.. ๏‚— It is defined in terms of (r or Recall) and (p or Precision) as follows. ๐น1๐‘†๐‘๐‘œ๐‘Ÿ๐‘’ = 2 โˆ— ๐‘…๐‘’๐‘๐‘Ž๐‘™๐‘™ . ๐‘ƒ๐‘Ÿ๐‘’๐‘๐‘–๐‘ ๐‘–๐‘œ๐‘› ๐‘…๐‘’๐‘๐‘Ž๐‘™๐‘™ + ๐‘ƒ๐‘Ÿ๐‘’๐‘๐‘–๐‘ ๐‘–๐‘œ๐‘› = 2๐‘‡๐‘ƒ 2๐‘‡๐‘ƒ + ๐น๐‘ƒ + ๐น๐‘ Note ๏‚— F1 represents the harmonic mean between recall and precision ๏‚— High value of F1 score ensures that both Precision and Recall are reasonably high.
  • 10. Analysis with Performance Measurement Metrics ๏‚ด Based on the various performance metrics, we can characterize a classifier. ๏‚ด We do it in terms of TPR, FPR, Precision and Recall and Accuracy ๏‚ด Case 1: Perfect Classifier When every instance is correctly classified, it is called the perfect classifier. In this case, TP = P, TN = N and CM is TPR = TP/(TP+FN)= ๐‘ƒ ๐‘ƒ =1 FPR = 0 ๐‘ =0 Precision = ๐‘ƒ ๐‘ƒ = 1 F1 Score = 2ร—1 1+1 = 1 Accuracy = ๐‘ƒ+๐‘ ๐‘ƒ+๐‘ = 1 10 Predicted Class + - Actual class + P 0 - 0 N
  • 11. Analysis with Performance Measurement Metrics ๏‚ด Case 2: Worst Classifier When every instance is wrongly classified, it is called the worst classifier. In this case, TP = 0, TN = 0 and the CM is TPR = 0 ๐‘ƒ =0 FPR = ๐‘ ๐‘ = 1 Precision = 0 ๐‘ = 0 F1 Score = Not applicable as Recall + Precision = 0 Accuracy = 0 ๐‘ƒ+๐‘ = 0 11 Predicted Class + - Actual class + 0 P - N 0
  • 12. Analysis with Performance Measurement Metrics ๏‚ด Case 3: Ultra-Liberal Classifier The classifier always predicts the + class correctly. Here, the False Negative (FN) and True Negative (TN) are zero. The CM is TPR = ๐‘ƒ ๐‘ƒ = 1 FPR = ๐‘ ๐‘ = 1 Precision = ๐‘ƒ ๐‘ƒ+๐‘ F1 Score = 2๐‘ƒ 2๐‘ƒ+๐‘ Accuracy = ๐‘ƒ ๐‘ƒ+๐‘ = 0 12 Predicted Class + - Actual class + P 0 - N 0
  • 13. Analysis with Performance Measurement Metrics ๏‚ด Case 4: Ultra-Conservative Classifier This classifier always predicts the - class correctly. Here, the False Negative (FN) and True Negative (TN) are zero. The CM is TPR = 0 ๐‘ƒ = 0 FPR = 0 ๐‘ = 0 Precision = Not applicable (as TP + FP = 0) F1 Score = Not applicable Accuracy = ๐‘ ๐‘ƒ+๐‘ = 0 13 Predicted Class + - Actual class + 0 p - 0 N