Evaluation Metrics
Evaluation Metrics
METHODS
IN MACHIENE LEARNING
AGENDA
01 02 03 04
What is the What is What is the What is an F₁
Confusion Accuracy, need for a score in
matrix in Precision and Confusion machine
machine Recall? matrix? learning?
learning?
WHY WE USE
CONFUSION MATRIX ?
ACCURACY
ACCURACY
Hence, Accuracy is not a suitable metric to use in situations where the data is
skewed, so in these situations, we use a confusion matrix.
WHAT IS THE
CONFUSION
MATRIX ?
CONFUSION MATRIX
This is a confusion matrix, it shows you all the possible scenarios of the predictions of a
model vs the ground truth.
It is a technique for summarizing the performance of a classification algorithm.
Let's co-relate this to a spam classifier dataset.
Case 1: Our model predicts a message as spam and actually it is
spam (TP - True Positive)
Case 2: Our model predicts a message as spam but in reality, it
is not (FP - False Positive)
Case 3: Our model predicts a message as not spam, but in
reality, it is spam (FN - False Negative)
Case 4: Our model predicts a message as not spam, and
actually it is not spam(TN - True Negative)
WHAT IS THE NEED FOR A
CONFUSION MATRIX?
WHAT IS PRECISION AND RECALL ?
PRECISION = Out of all the positive classes we have predicted
correctly, how many are actually positive or how good is our
model at not making false accusations?
RECALL: Out of all the predictions, how many are actually
correct?. This metric basically tells us how good our model is at
identifying relevant samples.
Recall and precision are related such that high
precision leads to low recall, and low precision leads
to high recall.
By making sure that the False Negative and False
positive are almost the same we can say that the
train and test data are balanced and having high
precision and recall.
We can calculate this by using a confusion matrix.
WHAT IS AN F₁ SCORE IN MACHINE LEARNING?
The F₁ score is the harmonic mean of precision and recall. The harmonic mean is a
special type of mean(average) which is explained by this formula.
Now if we optimize our model to have an F₁ score, we can have high precision and
recall.