0% found this document useful (0 votes)
2K views13 pages

Confusion Matrix: Dr. P. K. Chaurasia

The document discusses confusion matrices, which are used to evaluate classification models. A confusion matrix contains four terms: true positives, true negatives, false positives, and false negatives. These terms are used to calculate performance measures like accuracy, precision, recall, and error rate. Accuracy is calculated as the number of correct predictions divided by the total predictions. Precision is the number of true positives divided by the total predicted positives. Recall is the number of true positives divided by the total actual positives. Error rate is the number of incorrect predictions divided by the total predictions.

Uploaded by

aimsneet7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views13 pages

Confusion Matrix: Dr. P. K. Chaurasia

The document discusses confusion matrices, which are used to evaluate classification models. A confusion matrix contains four terms: true positives, true negatives, false positives, and false negatives. These terms are used to calculate performance measures like accuracy, precision, recall, and error rate. Accuracy is calculated as the number of correct predictions divided by the total predictions. Precision is the number of true positives divided by the total predicted positives. Recall is the number of true positives divided by the total actual positives. Error rate is the number of incorrect predictions divided by the total predictions.

Uploaded by

aimsneet7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

CONFUSION MATRIX

Dr. P. K. Chaurasia
Associate Professor,
Department of Computer Science and
Information Technology
MGCUB, Motihari, Bihar
Outline

 Introduction
 Confusion Matrix
 Matrix Terms
 Measure Terms
 Review Questions
 References
INTRODUCTION
• It is a table that is often used to describe the performance of a
classification model on a set of test data for which the true
values are known.

• It is a table of two dimensions; Actual Value and Predicted


Value.

• Confusion matrix, also known as an error matrix.


Cont…

 It has four dimensions


 True Positive (TP)

 True Negative (TN)

 False Positive (FP)

 False Negative (FN)


PREDICTED
A 185 NO YES
C NO 55 15 70
T [TN] [FP]
U Yes 10 105 115
A [FN] [TP]
L 65 120
Matrix Terms
• True Positives (TP) − It is the case when both
actual class & predicted class of data point is 1.
• True Negatives (TN) − It is the case when both
actual class & predicted class of data point is 0.
• False Positives (FP) − It is the case when actual
class of data point is 0 & predicted class of data
point is 1.
• False Negatives (FN) − It is the case when actual
class of data point is 1 & predicted class of data
point is 0.
Measure Terms

• Accuracy:
– It is how close a measured value to the actual (True)
value.

Accuracy = (TP + TN) /Total

= (55+105)/185

= 0.86
Cont…

• Precision:
– It is how close the measured values are to each other.

Precision = TP / Predicted Yes

= 105 / 120

= 0.87
Recall

• Recall:
– It is the ratio of all correctly predicted positive
predictions
Recall = TP / Actual Yes
= 105 / 115
= 0.91
Cont…

• Error Rate:
– It is calculated as the number of all incorrect
predictions divided by the total number of the
datasets.
– The best error rate is 0.0
– The worst error rate is 1.0.
Error Rate = 1 - Accuracy = (FN + FP) / Total
= 1 - 0.86 = (15 +10) /185
= 0.14
Review Questions

 What is the use of confusion Matrix?

 How we measure the performance ?

 What is Recall? Explain.

 What is Error Rate? Explain.

 What is Precision? Explain

 How we measure the accuracy? Explain with example.


References

 List of Books
 Understanding Machine Learning: From Theory to Algorithms.
 Introductory Machine Learning notes
 Foundations of Machine Learning
 List of website for references
 https://www.ic.unicamp.br/~wainer/cursos/1s2012/mc906/Confu
sion.pdf
 https://www.geeksforgeeks.org/confusion-matrix-machine-
learning/

You might also like