F-score
An F-score is a classification or evaluation metric combining precision and recall via their weighted harmonic mean; F1 is the equal-weight case.
Grokking Machine Learning
An F-score is a classification metric that combines precision and recall into a single value.
- How it is used
- Evaluates classification models when accuracy alone can hide missed positives or other important errors.
- How deep it goes
- Defines error counts, derives precision and recall from them, and combines both as F1; also introduces adjustable Fβ.
- Examples
- Uses medical diagnosis and spam-filter confusion matrices, an animal-video recommendation exercise, and validation predictions for a Titanic classifier.
- What you can do after
- Apply it via Scikit-Learn’s f1_score to validation predictions, or calculate F1 from confusion-matrix counts to compare classifiers.
Knowledge Graphs and LLMs in Action
F1 score is the harmonic mean of precision and recall.
- How it is used
- Evaluates whether classification and link-prediction models balance prediction accuracy with finding relevant cases.
- How deep it goes
- Defines the balance between precision and recall and applies it through validation plots and library scoring functions.
- Examples
- Uses AML licit-versus-illicit node classification and user–movie recommendation link prediction with GCN, GAT, and SAGE models.
- What you can do after
- Evaluate/understand model performance by comparing F1 score with precision and recall across validation epochs.
Read how Knowledge Graphs and LLMs in Action explains f-score →
Natural Language Processing in Action, Second Edition
F1 score is the harmonic mean of precision and recall for a classification or retrieval evaluation.
- How it is used
- Benchmarks classification and intent-detection systems by combining precision and recall into one comparison metric.
- How deep it goes
- Defines the harmonic-mean relationship and applies it across binary, multiclass, and multi-label evaluation without deriving the formula.
- Examples
- Uses toxic-comment moderation, linear classifiers, topic representations, and chatbot intent labels as evaluation examples.
- What you can do after
- Evaluate classification and intent systems, compare models, and diagnose weak intents by inspecting F1 with precision and recall.
Read how Natural Language Processing in Action, Second Edition explains f-score →
Deep Learning with PyTorch, Second Edition
A harmonic-mean classification metric that balances precision and recall, with the F-score parameter changing the relative emphasis between them.
- How it is used
- Evaluates nodule-candidate classification when high overall accuracy hides a model that predicts only negatives.
- How deep it goes
- Explains the arithmetic-average comparison and implements F1 in Python, then diagnoses undefined scores when precision and recall vanish.
- Examples
- Contrasts two precision-recall pairs and examines a nodule classifier reporting 99.8% accuracy but nan F1.
- What you can do after
- Build it from scratch using the F1 formula, log it by epoch, and diagnose undefined results.
Read how Deep Learning with PyTorch, Second Edition explains f-score →
Generative AI in Action
F-measure is a metric that combines precision and recall into a single balanced score.
- How it is used
- Uses F1 score to balance precision and recall when evaluating fine-tuned models and content filters.
- How deep it goes
- Defines the balance concept and identifies uses in ROUGE and BERTScore, without giving a calculation formula.
- Examples
- Illustrates F-score through reference-based summary evaluation, embedding-based text comparison, and content-filter assessment.
- What you can do after
- Evaluate/understand precision–recall trade-offs in content filters while checking error rates and qualitative feedback.
Effective Conversational AI
An F1 score is a classification metric that combines precision and recall through their harmonic mean.
- How it is used
- Guides classifier evaluation and identifies which intents should receive improvement effort.
- How deep it goes
- Explains F1 through recall, precision, classifier errors, and iterative metric comparisons, without detailing its mathematical derivation.
- Examples
- Uses #Request_Agent, #Login_Issue, and #Item_Not_Received test results to show metric interpretation and improvement.
- What you can do after
- Diagnose weak intents, choose representative training examples, and evaluate whether classifier revisions improve balanced performance.
Time Series Forecasting Using Foundation Models
F1 score is the harmonic mean of precision and recall.
- How it is used
- Evaluates anomaly detectors by balancing correctly flagged anomalies against missed anomalies and false positives.
- How deep it goes
- Explains the harmonic combination and implements it from confusion-matrix counts, but does not develop formal statistical theory.
- Examples
- Uses TimeGPT, Chronos, Moirai, Llama-3.2, and Time-LLM on daily New York City taxi-anomaly data.
- What you can do after
- Apply it via a Python evaluation function to compare anomaly predictions using precision, recall, and F1.
Read how Time Series Forecasting Using Foundation Models explains f-score →
Machine Learning Algorithms in Depth
The F1 score is the harmonic mean of precision and recall.
- How it is used
- Summarizes binary classification performance at a fixed threshold using precision and recall.
- How deep it goes
- Defines precision and recall, then gives the harmonic-mean formula without further derivation or implementation.
- Examples
- Uses precision-recall plots and threshold-specific performance summaries as the concrete evaluation setting.
- What you can do after
- Evaluate classification performance by combining precision and recall into one threshold-specific statistic.
Read how Machine Learning Algorithms in Depth explains f-score →
Data-Driven Cybersecurity
The F1-score is the harmonic mean of precision and recall for a classification class.
- How it is used
- Evaluates class-specific classification performance when both missed cases and incorrect alerts matter.
- How deep it goes
- Defines F1-score through precision and recall and interprets reports, but does not derive the harmonic-mean formula.
- Examples
- Uses cybersecurity article labels and network-traffic threat detection, with class-level reports and confusion-matrix visualizations.
- What you can do after
- Evaluate/understand whether a classifier balances detected cases against incorrect alerts and missed threats.
Grokking Statistics
The F-measure is a classification metric that combines precision and recall using their harmonic mean.
- How it is used
- Combines precision and recall into a single classification metric.
- How deep it goes
- Defines the harmonic-mean formula and its equal-weighting limitation, but stops short of deriving or implementing it.
- Examples
- Uses a wolf-alarm scenario to contrast perfect precision, poor recall, and frequent false alarms.
- What you can do after
- Evaluate/understand how one metric summarizes precision-recall balance while recognizing when equal weighting is unsuitable.
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
The harmonic mean of precision and recall used to evaluate classification performance.
- How it is used
- Uses the harmonic mean of precision and recall to evaluate classification performance, including tabular-data prediction tasks.
- How deep it goes
- Defines the metric and reports benchmark comparisons, but does not derive its formula or explain implementation details.
- Examples
- Compares XGBoost, ChatGPT, and Flan-T5 11b on TABLET prediction tasks using average F1 scores.
- What you can do after
- Evaluate and compare classification models with a combined precision-and-recall score.
Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains f-score →
Delivering Machine Learning Projects: From design to deployment
F1 score is the harmonic mean of precision and recall for a classification model.
- How it is used
- Frames classifier performance during design, testing, and model selection.
- How deep it goes
- Defines F1 score through precision and recall, then applies it in comparative evaluation without deriving the metric mathematically.
- Examples
- Compares models using F1 score with precision, recall, broader performance measures, and nonfunctional criteria.
- What you can do after
- Evaluate classification models using F1 score as part of a transparent, multi-measure selection decision.
Read how Delivering Machine Learning Projects: From design to deployment explains f-score →
Financial AI in Practice
The F1 score is the harmonic mean of precision and recall for a classification model.
- How it is used
- Guides fraud-model evaluation toward balancing fraud caught against legitimate customers incorrectly flagged.
- How deep it goes
- Defines F1 as the harmonic mean of precision and recall, and limits its use to cases with roughly equal error costs.
- Examples
- Contrasts a model with 99% accuracy that catches no fraud against metrics focused on fraud detection outcomes.
- What you can do after
- Evaluate fraud models with a balanced precision-recall metric when false-positive and false-negative costs are roughly equal.
Building LLM Applications with DSPy
A metric that combines precision and recall using their harmonic mean.
- How it is used
- Evaluates classification predictions using a standard metric alongside accuracy and other alternatives.
- How deep it goes
- Defines F1 as a classification metric but defers its use to a later treatment.
- What you can do after
- Evaluate classification results with F1 as one metric, while selecting a measure appropriate to the task.
Read how Building LLM Applications with DSPy explains f-score →
Related concepts
- precisionuses · Precision is the proportion of items identified as positive, selected, or retrieved that satisfy the relevant correctness or relevance criterion.
- recalluses · Recall is the fraction of relevant, positive, or target outcomes that a system successfully identifies, retrieves, or captures.
- evaluationused by · Evaluation is the systematic assessment of a system, result, or approach against relevant criteria, evidence, or objectives.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.













