The F1 score is a statistical measure of a test's accuracy that combines precision (the proportion of true positives among all positive predictions) and recall (the proportion of true positives among all actual positives) into a single value. It is calculated as 2 * (precision * recall) / (precision + recall), yielding a score between 0 and 1 where 1 represents perfect precision and recall.
Glossary
F1 Score

What is F1 Score?
The F1 score is the harmonic mean of precision and recall, providing a single balanced metric for model performance on imbalanced classification tasks like medication discrepancy detection.
In medication reconciliation automation, the F1 score is the primary evaluation metric because it balances the critical trade-off between missing a true discrepancy (false negative) and flagging a false positive that contributes to alert fatigue. A high F1 score indicates the model reliably identifies genuine medication errors without overwhelming clinical pharmacists with spurious alerts.
Key Characteristics of the F1 Score
The F1 score is the primary metric for evaluating medication reconciliation models, balancing the critical trade-off between missing a true discrepancy and overwhelming clinicians with false alarms.
Harmonic Mean of Precision and Recall
The F1 score is calculated as the harmonic mean of precision and recall, not a simple arithmetic average. This mathematical property ensures the score is disproportionately penalized when either precision or recall is extremely low, making it ideal for imbalanced clinical datasets where true medication discrepancies are rare events. A model that achieves 100% recall by flagging every drug as a discrepancy would have near-zero precision and thus a near-zero F1 score.
Precision: Minimizing Alert Fatigue
Precision answers: Of all the discrepancies the model flagged, how many were actual errors?
- High precision means fewer false positives, directly reducing alert fatigue in clinical decision support systems.
- A model with 0.95 precision generates only 5 false alarms per 100 flags, preserving clinician trust.
- Low precision causes pharmacists to override or ignore alerts, a dangerous phenomenon linked to missed adverse drug events (ADEs).
Recall: Ensuring Patient Safety
Recall answers: Of all the true medication discrepancies that exist, how many did the model successfully identify?
- High recall minimizes omission errors, the most common type of unintentional discrepancy during care transitions.
- A model with 0.98 recall catches 98% of clinically significant drug omissions, directly preventing potential adverse drug events.
- Missing a true discrepancy (false negative) can result in a patient not receiving a critical medication, making recall a patient safety imperative.
F1 Score in MedRec Model Evaluation
In medication reconciliation, the F1 score is typically calculated at the medication entry level rather than the document level:
- Each extracted drug name, dosage, frequency, and route is compared against a gold-standard annotated dataset.
- Cohen's Kappa is often reported alongside F1 to measure inter-annotator agreement on the ground truth labels.
- A clinically acceptable F1 threshold is typically ≥ 0.90, reflecting the high-stakes nature of medication safety.
Confidence Thresholding and the F1 Trade-off
The F1 score is directly influenced by the model's confidence threshold—the probability cutoff above which a prediction is considered positive:
- Lowering the threshold increases recall (fewer missed discrepancies) but decreases precision (more false positives).
- Raising the threshold increases precision (fewer nuisance alerts) but decreases recall (more missed errors).
- Human-in-the-loop (HITL) systems use confidence thresholding to route low-confidence predictions for pharmacist review, optimizing the operational F1 score.
Limitations of F1 in Clinical Contexts
While the F1 score is the standard metric, it has limitations in medication reconciliation:
- It treats precision and recall as equally important, but in some clinical scenarios, recall (patient safety) may be weighted more heavily than precision (efficiency).
- The F-beta score generalizes F1 by introducing a beta parameter; an F2 score weights recall twice as heavily as precision.
- F1 does not capture the clinical severity of a missed discrepancy—missing a warfarin interaction is far more consequential than missing a multivitamin omission.
Frequently Asked Questions
Explore the critical role of the F1 score as the primary evaluation metric for AI systems designed to automate medication reconciliation, balancing the detection of true discrepancies against the burden of false alarms.
The F1 score is the harmonic mean of precision and recall, providing a single balanced metric for a model's performance on a specific class. It is calculated as 2 * (Precision * Recall) / (Precision + Recall). Unlike arithmetic accuracy, the harmonic mean penalizes extreme imbalances between the two constituent metrics. For example, if a medication discrepancy model has a precision of 0.95 (very few false positives) but a recall of 0.10 (missing 90% of true errors), the F1 score will be a very low 0.18, accurately reflecting the model's dangerous failure to identify life-threatening omissions. This metric is preferred over raw accuracy in clinical settings because a dataset is typically dominated by correct, non-discrepant medication entries, making a naive model that predicts 'no error' appear highly accurate while being clinically useless.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core metrics and statistical methods used alongside the F1 Score to rigorously evaluate the performance and reliability of medication reconciliation AI systems.
Precision (Positive Predictive Value)
The fraction of AI-flagged medication discrepancies that are true positives—actual errors requiring clinical intervention. High precision minimizes alert fatigue by ensuring pharmacists are not wasting time on false alarms.
- Formula: True Positives / (True Positives + False Positives)
- Clinical Impact: A low precision means the system is crying wolf, flagging intentional therapeutic substitutions as errors.
- Example: If the AI flags 100 discrepancies but only 80 are real, the precision is 0.80.
Recall (Sensitivity)
The fraction of actual medication errors present in the chart that the AI successfully identified. High recall is critical for patient safety, ensuring no dangerous omission or duplication slips through.
- Formula: True Positives / (True Positives + False Negatives)
- Clinical Impact: A low recall means the system is missing real, potentially fatal, adverse drug events.
- Trade-off: Maximizing recall often decreases precision, generating more false positives.
Cohen's Kappa (Inter-Annotator Agreement)
A robust statistical measure that quantifies the level of agreement between two clinical pharmacists labeling the same medication list. Unlike raw percentage agreement, it corrects for the probability of random chance.
- Scale: -1 (perfect disagreement) to +1 (perfect agreement).
- Ground Truth Quality: A low Kappa score indicates ambiguous annotation guidelines, making it impossible to train a reliable F1-optimized model.
- Benchmark: A Kappa > 0.80 is generally considered strong agreement for clinical data.
Confidence Thresholding
A probabilistic gate that routes predictions for human review based on the model's certainty. Only discrepancies where the model's F1-optimized confidence score falls below a set boundary are sent to a pharmacist.
- High Threshold: Automates only the most obvious matches, maximizing precision but requiring heavy manual labor.
- Low Threshold: Automates more tasks but risks introducing errors into the Best Possible Medication History (BPMH).
- Goal: Find the threshold that maximizes the F1 score in the production workflow.
Hallucination Guardrails
Deterministic post-processing rules that prevent the model from generating clinically impossible outputs, regardless of the F1 score on validation data. These are safety nets, not statistical metrics.
- RxNorm Validation: Rejects any generated drug name that does not exist in the RxNorm database.
- Dose Sanity Checks: Flags a dosage of '5000 mg' of a drug typically dosed in micrograms.
- Temporal Logic: Prevents a 'discontinued' date from occurring before a 'started' date.
NegEx Algorithm
A regular expression-based NLP algorithm that determines if a clinical finding is negated. Without this, an F1 score becomes meaningless because the system confuses 'patient denies chest pain' with an active symptom.
- Mechanism: Identifies negation phrases ('no evidence of', 'denies') within a window of the target term.
- Relevance: Crucial for distinguishing 'no medication changes' from an active list of changes.
- Evolution: Modern systems use contextual embeddings (like ClinicalBERT) that outperform rigid regex rules.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us