XXooptRobotics

Computing F1 from a confusion matrix

mediumnumerical

General

A binary classifier is evaluated on a held-out test set, producing the following confusion matrix (positive = the class of interest):

| | Predicted Positive | Predicted Negative | |---|---|---| | Actual Positive | TP = 40 | FN = 20 | | Actual Negative | FP = 10 | TN = 30 |

Compute the F1 score for the positive class. Recall that F1=2precisionrecallprecision+recallF_1 = 2 \cdot \dfrac{\text{precision} \cdot \text{recall}}{\text{precision} + \text{recall}}, where precision=TPTP+FP\text{precision} = \dfrac{TP}{TP+FP} and recall=TPTP+FN\text{recall} = \dfrac{TP}{TP+FN}. Give your answer rounded to 3 decimal places.

dimensionless (score in [0, 1])