Entri Blog
No Result
View All Result
Friday, March 24, 2023
  • State PSC
    • Kerala PSC
    • TNPSC
    • APPSC
    • TSPSC
    • BPSC
    • Karnataka PSC
    • MPPSC
    • UPPSC
  • Banking
    • IBPS PO Notification
    • IBPS Clerk Notification
    • SBI PO Notification
    • SBI Clerk Notification
    • SBI SO Notification
    • SBI Apprentice Notification
    • Canara Bank PO Notification
    • Indian Bank PO Notification
    • RBI Assistant Notification
    • RBI Office Attendant Notification
    • IBPS RRB Notification
    • IBPS RRB Office Assistant Notification
  • Govt Exams
    • Railway
    • SSC
  • Skilling
    • Coding
    • Spoken English
    • Stock Marketing
  • TET
    • APTET
    • CTET
    • DSSSB
    • Karnataka TET
    • Kerala TET
    • KVS
    • MPTET
    • SUPER TET
    • TNTET
    • TSTET
    • UPTET
  • Courses
    • Data Science Course
      • Data Science Malayalam
    • Full Stack Developer Course
      • Full Stack Development Malayalam
      • Full Stack Development Hindi
      • Full Stack Development Tamil
      • Full Stack Development Telugu
      • Full Stack Development Kannada
    • Stock Market Course
      • Stock Market Course in Malayalam
      • Stock Market Course in Tamil
      • Options Trading Course
    • Spoken English Course
      • Spoken English Course in Malayalam
      • Spoken English Course in Hindi
      • Spoken English Course in Telugu
      • Spoken English Course in Tamil
      • Spoken English Course in Kannada
  • Others
    • GATE
    • MAT
    • KMAT
Free English Quiz: Try Now!
Entri Blog
  • State PSC
    • Kerala PSC
    • TNPSC
    • APPSC
    • TSPSC
    • BPSC
    • Karnataka PSC
    • MPPSC
    • UPPSC
  • Banking
    • IBPS PO Notification
    • IBPS Clerk Notification
    • SBI PO Notification
    • SBI Clerk Notification
    • SBI SO Notification
    • SBI Apprentice Notification
    • Canara Bank PO Notification
    • Indian Bank PO Notification
    • RBI Assistant Notification
    • RBI Office Attendant Notification
    • IBPS RRB Notification
    • IBPS RRB Office Assistant Notification
  • Govt Exams
    • Railway
    • SSC
  • Skilling
    • Coding
    • Spoken English
    • Stock Marketing
  • TET
    • APTET
    • CTET
    • DSSSB
    • Karnataka TET
    • Kerala TET
    • KVS
    • MPTET
    • SUPER TET
    • TNTET
    • TSTET
    • UPTET
  • Courses
    • Data Science Course
      • Data Science Malayalam
    • Full Stack Developer Course
      • Full Stack Development Malayalam
      • Full Stack Development Hindi
      • Full Stack Development Tamil
      • Full Stack Development Telugu
      • Full Stack Development Kannada
    • Stock Market Course
      • Stock Market Course in Malayalam
      • Stock Market Course in Tamil
      • Options Trading Course
    • Spoken English Course
      • Spoken English Course in Malayalam
      • Spoken English Course in Hindi
      • Spoken English Course in Telugu
      • Spoken English Course in Tamil
      • Spoken English Course in Kannada
  • Others
    • GATE
    • MAT
    • KMAT
No Result
View All Result
Entri Blog
English Quiz
banner top article banner top article
Home Articles

Confusion Matrix in Machine Learning

by Ramzeena Althaf
February 21, 2023
in Articles, Data Science and Machine Learning, Entri Skilling
Confusion Matrix in Machine Learning
Share on FacebookShare on WhatsAppShare on Telegram

Table of Contents

  • What is Confusion Matrix?
  • Outcomes of Confusion Matrix
  • Example of Confusion Matrix
  • Important Terms using a Confusion matrix
  • How to Calculate a Confusion Matrix?
  • Benefits of Using a Confusion Matrix

What is Confusion Matrix?

A confusion matrix is a performance measurement technique for Machine learning classification. It measures the performance of a classifier in depth. Confusion matrix helps us know performance of the classification model on a set of test data for that the true values are known.

A confusion matrix is a summary of prediction results on a classification problem. It gives you insight not only into the errors being made by your classifier but more importantly the types of errors that are being made.

Looking for a Data Science Career? Explore Here!

Outcomes of Confusion Matrix

The four different combinations from the predicted and actual values of a classifier are:

  • True Positive (TP): You predicted positive values and it is positive.
  • False Positive (FP): You predicted positive values but it is actually negative.
  • False Negative (FN): You precited negative value but it is actually positive.
  • True Negative (TN): You predicted negative value and it is negative.

Example of Confusion Matrix

Suppose you predict the result of a cricket match between India and Australia.

  • True Positive: When you predict a positive outcome and it turns out to be correct. Suppose you predict that India will win and it wins.
  • True Negative: When you predict a negative outcome and it turns out to be correct. Suppose you predict that India will lose and it loses.
  • False Positive: When you predict a positive outcome and it turns out to be wrong. Suppose you predict that India will win and it loses.
  • False negative: When you predict a negative outcome and it turns out to be correct. Suppose you predict that India will lose but it wins.

Important Terms using a Confusion matrix

Precision:  It measures how good our model is when the prediction is positive. It measures how likely the prediction of the positive class is correct. It is useful for the conditions where false positive is a higher concern as compared to a false negative.

precision

 

Recall: Precision alone is not very helpful because it ignores the negative class. It measures how good our model is at correctly predicting positive classes. It is the ratio of correct positive predictions to all positive classes. It is useful when false negative dominates false positives.

recall

Accuracy: It is used to find the portion of correctly classified values. It is the sum of all true values divided by total values.
accuracy
Sensitivity: It measures the proportion of positive class that is correctly predicted as positive and hence it is also known as True Positive Rate (TPR). It is the same as recall.
Specificity: It measures the proportion of negative class that is correctly predicted as negative.
F1 score: It is a weighted average score of the precision and recall. It is useful when you need to take both Precision and Recall into account.
f1score
Roc Curve: It shows the true positive rates against the false positive rate at various cut points. It also demonstrates a trade-off between sensitivity.
Null Error Rate: For the conditions when the model always predicted the majority class, null error rate defines how frequently the model would be incorrect.
Misclassification Rate: It explains how repeatedly the mode yields the wrong predictions, and also known as error rate.

How to Calculate a Confusion Matrix?

  1. You need a test dataset or a validation dataset with expected outcome values.
  2. Predict all the rows in the test dataset.
  3. From the expected outcomes and predictions count:
  • The total of correct predictions of each class.
  • The total of incorrect predictions of each class.
Then organize the numbers into a table, or a matrix as follows:
  • Each row of the matrix links to a predicted class.
  • Each column of the matrix corresponds with an actual class.
  • Enter the total counts of correct and incorrect classification into the table.
  • The sum of correct predictions for a class go into the predicted column and expected row for that class value.
  • The sum of incorrect predictions for a class goes into the expected row for that class value and the predicted column for that specific class value.

Join Our Data Science and Machine Learning Course! Enroll Here!

Benefits of Using a Confusion Matrix

  • It provides an insight not only to the errors which are made by a classifier but also errors that are being made.
  • It reflects how a classification model is disorganized and confused while making predictions.
  • It is a useful machine learning method which allows you to measure Recall, Precision, Accuracy, and AUC-ROC curve.
  • It assists in prevailing over the limitations of deploying classification accuracy alone.

In short, a confusion matrix is a summarized table of the number of correct and incorrect predictions for binary classification tasks. By visualizing the confusion matrix, an individual could determine the accuracy of the model by observing the diagonal values for measuring the number of accurate classification.

Related Articles
Understanding Machine Learning Basics – A Simple Guide Importance of Data Preprocessing in Machine Learning
Exploratory Data Analysis in Machine Learning – EDA Steps, Importance Data Analysis – Process, Methods, Types
Best Data Science Skills for Data Science Career What is Data Interpretation? Methods and Benefits
Share62SendShare
Ramzeena Althaf

Ramzeena Althaf

Ramzeena is a free thinker, an avid reader and tenacious when it comes to writing. An ardent Scrabble lover, she loves sharing exam updates and related topics for aspirants

Related Posts

Top 100 Angular Interview Questions and Answers 2023
Articles

Top 100 Angular Interview Questions and Answers 2023

March 23, 2023
Top 100 SQL query Interview Questions and Answers for 2023
Articles

Top 100 SQL query Interview Questions and Answers for 2023

March 23, 2023
Indian Air Force Agniveer Vayu Selection Process 2023: Details Here
Articles

Indian Air Force Agniveer Vayu Selection Process 2023: Details Here

March 23, 2023
Next Post
Paragraph Writing on Covid 19

Paragraph Writing on Covid 19 - Samples

Discussion about this post

Latest Posts

  • Top 100 Angular Interview Questions and Answers 2023
  • Top 100 SQL query Interview Questions and Answers for 2023
  • Indian Air Force Agniveer Vayu Selection Process 2023: Details Here
  • How to Write a Speech – Format
  • Auxiliary Verbs: Usage and Examples

Trending Posts

  • states of india and their capitals and languages

    List of 28 States of India and their Capitals and Languages 2023 – PDF Download

    150261 shares
    Share 60102 Tweet 37564
  • List of Government Banks in India 2023: All you need to know

    61860 shares
    Share 24744 Tweet 15465
  • TNPSC Group 2 Posts and Salary Details 2022

    39693 shares
    Share 15877 Tweet 9923
  • KSDA Recruitment 2023 Apply Online for 9264 FDA SDA Posts – Qualification

    2076 shares
    Share 830 Tweet 519
  • New Map of India with States and Capitals 2023

    28793 shares
    Share 11517 Tweet 7198

Courses

  • Data Science Course
  • Full Stack Developer Course
  • Data Science Course in Malayalam
  • Full Stack Developer Course in Malayalam
  • Full Stack Developer Course in Hindi
  • Full Stack Developer Course in Tamil
  • Full Stack Developer Course in Telugu
  • Full Stack Developer Course in Kannada

Company

  • Become a teacher
  • Login to Entri Web

Quick Links

  • Articles
  • Videos
  • Entri Daily Quiz Practice
  • Current Affairs & GK
  • News Capsule – eBook
  • Preparation Tips
  • Kerala PSC Gold
  • Entri Skilling

Popular Exam

  • IBPS Exam
  • SBI Exam
  • Railway RRB Exam
  • Kerala PSC
  • Tamil Nadu PSC
  • Telangana PSC
  • Andhra Pradesh PSC
  • MPPSC
  • UPPSC
  • Karnataka PSC
  • Staff Selection Commission Exam

© 2021 Entri.app - Privacy Policy | Terms of Service

No Result
View All Result
  • State PSC
    • Kerala PSC
    • TNPSC
    • APPSC
    • TSPSC
    • BPSC
    • Karnataka PSC
    • MPPSC
    • UPPSC
  • Banking
    • IBPS PO Notification
    • IBPS Clerk Notification
    • SBI PO Notification
    • SBI Clerk Notification
    • SBI SO Notification
    • SBI Apprentice Notification
    • Canara Bank PO Notification
    • Indian Bank PO Notification
    • RBI Assistant Notification
    • RBI Office Attendant Notification
    • IBPS RRB Notification
    • IBPS RRB Office Assistant Notification
  • Govt Exams
    • Railway
    • SSC
  • Skilling
    • Coding
    • Spoken English
    • Stock Marketing
  • TET
    • APTET
    • CTET
    • DSSSB
    • Karnataka TET
    • Kerala TET
    • KVS
    • MPTET
    • SUPER TET
    • TNTET
    • TSTET
    • UPTET
  • Courses
    • Data Science Course
      • Data Science Malayalam
    • Full Stack Developer Course
      • Full Stack Development Malayalam
      • Full Stack Development Hindi
      • Full Stack Development Tamil
      • Full Stack Development Telugu
      • Full Stack Development Kannada
    • Stock Market Course
      • Stock Market Course in Malayalam
      • Stock Market Course in Tamil
      • Options Trading Course
    • Spoken English Course
      • Spoken English Course in Malayalam
      • Spoken English Course in Hindi
      • Spoken English Course in Telugu
      • Spoken English Course in Tamil
      • Spoken English Course in Kannada
  • Others
    • GATE
    • MAT
    • KMAT

© 2021 Entri.app - Privacy Policy | Terms of Service