We begin the calculation by first using the formula to calculate Precision Precision is defined as the percentage of true positive cases versus all the cases where the prediction is true. That is, it takes into account the True Positives and False Positives.
Next, we calculate recall as the fraction of positive cases that are correctly identified.
Finally, we calculate the F1 score as the measure of the balance between precision and recall.
F1 score = 2 × 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 × 𝑅𝑒𝑐𝑎𝑙𝑙 /𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 +𝑅𝑒𝑐𝑎𝑙.