F-beta Score Calculator — F1, F2, F0.5
Compute the F-beta score of a binary classifier from precision and recall or from raw confusion-matrix counts (TP, FP, FN). Presets for F1, F2, and F0.5, plus any custom beta — with F0.5, F1, and F2 shown side by side. Uses the exact scikit-learn formula.
How it works
The F-beta score is a single number that blends precision (of the items the model flagged positive, how many really were) and recall (of the real positives, how many the model caught). The parameter beta decides how much more recall matters than precision. This tool implements the formula exactly as scikit-learn's fbeta_score does, which traces back to Van Rijsbergen's effectiveness measure (1979) and Chinchor's MUC-4 F-measure (1992).
If you enter confusion-matrix counts, precision and recall are derived first:
- precision = TP / (TP + FP)
- recall = TP / (TP + FN)
The F-beta score itself uses the precision/recall form:
F_beta = (1 + β²) · (precision · recall) / (β² · precision + recall)
To make the result trustworthy, the calculator also computes it a second way — straight from the counts — and confirms the two agree to full floating-point precision:
F_beta = (1 + β²) · TP / ((1 + β²) · TP + β² · FN + FP)
Beta controls the trade-off. With β = 1 the two contributions are equal and F1 is the harmonic mean of precision and recall. With β = 2 recall is weighted twice as heavily as precision, so F2 rises when a model catches more true positives — the reason it is preferred for screening tasks. With β = 0.5 precision is weighted twice as heavily, so F0.5 rewards models that avoid false alarms. When precision and recall are equal, every F-score is identical no matter the beta.
One edge case matters: if precision and recall are both zero (no true positives), the denominator is zero. Rather than return an undefined value, the tool follows the scikit-learn convention and reports a score of 0, so the number is always safe to use in a pipeline. Scores display to four decimal places, but the underlying math keeps full precision.
Worked examples
Frequently asked questions
Sources & references
- scikit-learn — fbeta_score API reference (formula & edge cases)
- scikit-learn — Precision, recall and F-measures user guide
- Van Rijsbergen, C. J. (1979). Information Retrieval, 2nd ed. (Ch. 7 — effectiveness measure)
- Chinchor, N. (1992). MUC-4 Evaluation Metrics (F-measure in NLP/IR)
Formulas and edge-case conventions on this page were last cross-checked against the scikit-learn documentation on 2026-07-13. Both computation paths — precision/recall and confusion-matrix — are verified to agree for every worked example above.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.