Home

F1Scores

F1 score is a performance metric used in binary classification to balance precision and recall. It is the harmonic mean of precision and recall, defined as F1 = 2 × (precision × recall) / (precision + recall). Precision equals TP / (TP + FP) and recall equals TP / (TP + FN), where TP, FP, and FN are true positives, false positives, and false negatives. The F1 score ranges from 0 to 1, with 1 indicating perfect precision and recall.

The F1 score is especially useful when the class distribution is imbalanced or when false positives and

For multiclass problems, F1 can be extended by computing per-class F1 scores and then aggregating. Common approaches

The metric can be generalized with the Fβ score, which weights recall more than precision when β >

Limitations include sensitivity to the chosen threshold for converting scores to class labels and the fact

false
negatives
carry
different
costs.
Unlike
accuracy,
F1
provides
a
single
metric
that
accounts
for
both
false
positives
and
false
negatives
for
the
positive
class.
are
macro
F1
(unweighted
average
of
per-class
F1s),
micro
F1
(global
counts
of
TP,
FP,
FN
across
all
classes),
and
weighted
F1
(per-class
F1
weighted
by
class
support).
1
and
precision
more
when
β
<
1.
F1
corresponds
to
β
=
1,
giving
equal
weight
to
precision
and
recall.
that
it
ignores
true
negatives.
It
may
also
be
misleading
for
very
small
classes
or
when
the
costs
of
false
positives
and
false
negatives
vary
significantly.
Despite
these
caveats,
the
F1
score
is
a
widely
used,
interpretable
metric
for
evaluating
classification
performance.