Skip to content
Machine Learning

What is F1-score?

Is a measure of a test's accuracy. F1-score is the harmonic mean of the precision and recall.

datasciencetrivia.com

Card 1 of 259. Answer: Is a measure of a test's accuracy. F1-score is the harmonic mean of the precision and recall.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.

The longer answer

The F1 score is the harmonic mean of precision and recall: F1 = 2 · precision · recall / (precision + recall). It runs from 0 to 1 and is high only when both precision and recall are high.

Example: a fraud model flags 100 transactions, 60 of which are fraud, out of 120 frauds in total. Precision is 60/100 = 0.6, recall is 60/120 = 0.5, and F1 = 2 · 0.6 · 0.5 / 1.1 ≈ 0.55. The harmonic mean punishes imbalance, so precision 1.0 with recall 0.1 gives an F1 of only about 0.18.

F1 is the usual choice on imbalanced data, where accuracy is misleading, but it ignores true negatives and assumes precision and recall matter equally. When they don't, use F-beta (F2 weights recall more, F0.5 weights precision more). For multi-class problems, macro-F1 averages the per-class scores and micro-F1 pools all predictions first.

All questions