Thursday, September 25, 2025

CLASS X (Aritificial Intelligence) - Confusion Matrix and the four methods to evaluate the model

 

Confusion Matrix and the four methods to evaluate the model

Confusion Matrix - The comparison between the results of Prediction and reality is called the Confusion Matrix.

How to interpret a confusion matrix for a machine learning model

There are four methods to evaluate the model











 
 

  

 

 

 

 

 

 

 

 

 

 

 

 

 


QUSTION

Consider the scenario where the AI model is created to predict if there will be rain or not. The confusion matrix for the same is given below. Calculate precision, accuracy and recall.

TP = 70   TN = 50

FN = 50  FP = 30

NOW CALCULATE ALL FOUR (ACCURACY, PRECISION, RECALL AND F1 SCORE) USING GIVEN FORMULAS



 

 

 

 

ACCURACY = (70+50) / (70 + 50 + 30 + 50) * 100

ACCURACY = 120/200 * 100

ACCURACY = 60 %

 



 

 

 

 

 


PRECISION = 70/(70 + 30) * 100

PRECISION = 70/100 * 100

PRECISION = 70%

 

 

RECALL = 70/(70 + 50)

RECALL = 70/120

RECALL = 0.583

 

 

 F1 SCORE = 2 * (70 * 0.583)/( 70 + 0.583)

F1 SCORE = 2 * (40.81)/ 70.583

F1 SCORE = 2 * 0.578

F1 SCORE = 1.156

 

How many total tests were performed in the above scenario?

TP + TN + FN + FP

70 + 50 + 50 + 30 = 200

 

 

 

 

HOMEWORK

 

 

 

 

No comments:

Post a Comment