What is the F1 score in machine learning?
In our previous article, we discussed what precision and recall are in machine learning and how to calculate precision and recall scores using the sklearn Python library. The F1 score is the harmonic mean of precision and recall. Let’s try to understand this.
We know that,
True Positives (TP): True positives are those output labels that are predicted to be True and they are actually True.
True Negatives (TN): True negatives are the output labels that are predicted to be False and they are actually False also.
False Positives (FP): False positives are the output labels that are predicted to be True but they are actually False.
False Negatives (FN): False negatives are those output labels that are predicted to be False but they are actually True.
And, precision and recall in machine learning are defined as:
The F1 score is defined as:
Let’s look at an example. Let’s say the expected or actual output for a classification problem is: …






0 Comments