ArticleslgStudy

mathematics

F-score

F-score is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand F-score rather than just read about it. In short: In statistical analysis of binary classification and information retrieval systems, the F-score or F-measure is a measure of predictive performance. It is calculated from the precision and recall of the test, where the precision is the number of true positive results divided by the number of all samples predicted to be positive, including those not identified correctly, and the recall is the number of true positive…

F-score — main illustration
F-score — illustration

Key takeaways

  • F-score belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect F-score to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of F-score from memory before moving on to harder problems.

Reference excerpt

In statistical analysis of binary classification and information retrieval systems, the F-score or F-measure is a measure of predictive performance. It is calculated from the precision and recall of the test, where the precision is the number of true positive results divided by the number of all samples predicted to be positive, including those not identified correctly, and the recall is the number of true positive results divided by the number of all samples that should have been identified as positive. Precision is also known as positive predictive value, and recall is also known as sensitivity in diagnostic binary classification. The F1 score is the harmonic mean of the precision and recall. It thus symmetrically represents both precision and recall in one metric. The more generic Fβ score applies additional weights, valuing one of precision or recall more than the other. The highest possible value of an F-score is 1.0, indicating perfect precision and recall, and the lowest possible value is 0, if the precision or the recall is zero.

Etymology The name F-measure is believed to be named after a different F function in Van Rijsbergen's book, when introduced to the Fourth Message Understanding Conference (MUC-4, 1992).

Definition The traditional F-measure or balanced F-score (F1 score) is the harmonic mean of precision and recall:

F1=2recall−1+precision−1=2precision⋅recallprecision+recall=2TP2TP+FP+FN With precision = TP / (TP + FP) and recall = TP / (TP + FN), it follows that the numerator of F1 is the sum of their numerators and the denominator of F1 is the sum of their denominators. If FP = FN F1=2TP2TP+2FP=TPTP+FP or F1=2TP2TP+2FN=TPTP+FN So, F1 = precision = recall If TP = FP = FN F1=2TP2TP+2FP=2TP4TP=12=0.5 or F1=2TP2TP+2FN=2TP4TP=12=0.5 To see it as a harmonic mean, note that F1−1=12(recall−1+precision−1).

Fβ score A more general F score, Fβ, that uses a positive real factor β, where β is chosen such that recall is considered β2 times as important as precision, is:

Fβ=β2+1(β2⋅recall−1)+precision−1=(1+β2)⋅precision⋅recall(β2⋅precision)+recall To see that as a weighted harmonic mean, note that Fβ−1=1β+β−1(β⋅recall−1+β−1⋅precision−1). In terms of Type I and type II errors this becomes:

Fβ=(1+β2)⋅TP(1+β2)⋅TP+β2⋅FN+FP=(1+β2)⋅TP(TP+FN)⋅β2+(TP+FP) Two commonly used values for β are 2, which weighs recall higher than precision, and 1/2, which weighs recall lower than precision. The F-measure was derived so that Fβ "measures the effectiveness of retrieval with respect to a user who attaches β times as much importance to recall as precision". It is based on Van Rijsbergen's effectiveness measure

E=1−(αp+1−αr)−1 Their relationship is: Fβ=1−E where α=11+β2

Diagnostic testing This is related to the field of binary classification where recall is often termed "sensitivity".

Dependence of the F-score on class imbalance Precision-recall curve, and thus the Fβ score, explicitly depends on the ratio r of positive to negative test cases. This means that comparison of the F-score across different problems with differing class ratios is problematic. One way to address this issue (see e.g., Siblini et al., 2020) is to use a standard class ratio r0 when making such comparisons.

Applications The F-score is often used in the field of information retrieval for measuring search, document classification, and query classification performance. It is particularly relevant in applications which are primarily concerned with the positive class and where the positive class is rare relative to the negative class. Earlier works focused primarily on the F1 score, but with the proliferation of large scale search engines, performance goals changed to place more emphasis on either precision or recall and so Fβ is seen in wide application. The F-score is also used in machine learning. However, the F-measures do not take true negatives into account, hence measures such as the Matthews correlation coefficient, Informedness or Cohen's kappa may be preferred to assess the performance of a binary classifier. The F-score has been widely used in the natural language processing literature, such as in the evaluation of named entity recognition and word segmentation.

Properties The F1 score is the Dice coefficient of the set of retrieved items and the set of relevant items.

The F1-score of a classifier which always predicts the positive class converges to 1 as the probability of the positive class increases. The F1-score of a classifier which always predicts the positive class is equal to 2 * proportion_of_positive_class / ( 1 + proportion_of_positive_class ), since the recall is 1, and the precision is equal to the proportion of the positive class. If the scoring model is uninformative (cannot distinguish between the positive and negative class) then the optimal threshold is 0 so that the positive class is always predicted. F1 score is concave in the true positive rate.

Criticism David Hand and others criticize the widespread use of the F1 score since it gives equal importance to precision and recall. In practice, different types of mis-classifications incur different costs. In other words, the relative importance of precision and recall is an aspect of the problem. According to Davide Chicco and Giuseppe Jurman, the F1 score is less truthful and informative than the Matthews correlation coefficient (MCC) in binary evaluation classification. David M W Powers has pointed out that F1 ignores the True Negatives and thus is misleading for unbalanced classes, while kappa and correlation measures are symmetric and assess both directions of predictability - the classifier predicting the true class and the true class predicting the classifier prediction, proposing separate multiclass measures Informedness and Markedness for the two directions, noting that their geometric mean is correlation. Another source of critique of F1 is its lack of symmetry. It means it may change its value when dataset labeling is changed - the "positive" samples are named "negative" and vice versa. This criticism is met by the P4 metric definition, which is sometimes indicated as a symmetrical extension of F1. Finally, Ferrer and Dyrland et al. argue that the expected cost (or its counterpart, the expected utility) is the only principled metric for evaluation of classification decisions, having various advantages over the F-score and the MCC. Both works show that the F-score can result in wrong conclusions about the absolute and relative quality of systems.

… excerpt ends here. Continue reading the full article.

Illustrations

F-score: Precision and recall
Precision and recall
F-score: Normalised harmonic mean plot where x is precision, y is recall and the vertical axis is F1 score, in percentage points
Normalised harmonic mean plot where x is precision, y is recall and the vertical axis is F1 score, in percentage points
F-score: Precision-Recall Curve: points from different thresholds are color coded, the point with optimal F-score is highlighted in red
Precision-Recall Curve: points from different thresholds are color coded, the point with optimal F-score is highlighted in red

Worked examples

Example 1 — a first encounter with F-score

Start with the simplest possible case. Write down what F-score claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to F-score before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about F-score ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of F-score

In research
F-score appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses F-score in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
F-score is common in secondary-school and first-year university syllabi. It links to neighbouring topics Clustering criteria, Evaluation of machine translation, Statistical natural language processing, so understanding it makes those chapters shorter.
In everyday life
Look for F-score outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “F-score” →

How to study F-score in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what F-score means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain F-score out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is F-score in simple terms?

In statistical analysis of binary classification and information retrieval systems, the F-score or F-measure is a measure of predictive performance. It is calculated from the precision and recall of the test, where the precision is the number of true positive results divided by the number of all sa…

Why does F-score matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study F-score?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on F-score.

Tags

  • Clustering criteria
  • Evaluation of machine translation
  • Statistical natural language processing
  • Statistical ratios
  • Summary statistics for contingency tables

Keep exploring