The F1 score is the harmonic mean of precision and recall, and is used to evaluate the balance between the two metrics.
It is particularly useful when the class distribution is imbalanced.
Usage
calculate_f1(metrics, target)
Arguments
metrics
A vector of predicted class labels or probabilities.