A confusion matrix is a tabular summary used to visualize the performance of a classification algorithm by comparing its predicted labels against the true, ground-truth labels. It categorizes outcomes into four core cells: True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN). This structure provides a complete picture of correct classifications and error types, forming the basis for all standard classification metrics like precision, recall, and F1-score.
Glossary
Confusion Matrix

What is a Confusion Matrix?
A confusion matrix is a fundamental tool for evaluating the performance of a classification model, particularly in tasks like entity resolution.
In entity resolution, the matrix evaluates a model's ability to correctly link records representing the same entity (positives) and distinguish records representing different entities (negatives). A false positive is an incorrect match (two different records linked), while a false negative is a missed match (two records for the same entity not linked). Analyzing the matrix's distribution helps data engineers tune the trade-off between precision (minimizing false matches) and recall (minimizing missed matches) for their specific use case.
Components of a Confusion Matrix
This table defines the four core cells of a confusion matrix and their derived performance metrics, which are used to evaluate classification models in entity resolution.
| Component | Definition | Entity Resolution Context | Derived Metric |
|---|---|---|---|
True Positive (TP) | The model correctly predicts the positive class. Records are correctly linked as the same entity. | Two records that refer to the same real-world person are correctly matched by the entity resolution system. | Recall, Precision |
False Positive (FP) | The model incorrectly predicts the positive class. Records are incorrectly linked as the same entity. | Two records that refer to different people are incorrectly matched by the system (a false link). | Precision, False Discovery Rate |
True Negative (TN) | The model correctly predicts the negative class. Records are correctly identified as different entities. | Two records that refer to different people are correctly left unmatched by the system. | Specificity, Negative Predictive Value |
False Negative (FN) | The model incorrectly predicts the negative class. Records that are the same entity are incorrectly left unlinked. | Two records that refer to the same person are not matched by the system (a missed link). | Recall, False Omission Rate |
Precision | The proportion of predicted matches that are correct. TP / (TP + FP). | Measures the accuracy of the links the system creates. A high precision means few false links. | |
Recall (Sensitivity) | The proportion of actual matches that are found. TP / (TP + FN). | Measures the system's ability to find all true matches. A high recall means few missed links. | |
F1-Score | The harmonic mean of precision and recall. 2 * (Precision * Recall) / (Precision + Recall). | A single metric that balances the trade-off between precision and recall. | |
Specificity | The proportion of actual non-matches correctly identified. TN / (TN + FP). | Measures the system's ability to correctly reject non-matching record pairs. |
Key Metrics Derived from a Confusion Matrix
A confusion matrix provides the raw counts of a classification model's predictions. These core counts are used to calculate the fundamental metrics that quantify the model's accuracy, error types, and overall performance.
Accuracy
Accuracy is the proportion of total predictions that the model got correct. It is calculated as (True Positives + True Negatives) / Total Predictions.
- Use Case: Provides a high-level overview of model performance when the class distribution is balanced.
- Limitation: Can be misleading for imbalanced datasets. For example, a model that always predicts the majority class in a dataset with 95% negative examples will have 95% accuracy but fails completely on the positive class.
- Formula: (TP + TN) / (TP + TN + FP + FN)
Precision
Precision (or Positive Predictive Value) measures the model's exactness when it makes a positive prediction. It answers: "Of all the records the model labeled as a match, what fraction were actually matches?"
- Focus: Quality of positive predictions. High precision means the model's matches are trustworthy.
- Critical For: Entity resolution tasks where a false match (merging two different entities) has high downstream costs, such as in customer data integration or financial compliance.
- Formula: TP / (TP + FP)
Recall
Recall (or Sensitivity, True Positive Rate) measures the model's completeness in finding all actual positives. It answers: "Of all the true matches that exist, what fraction did the model successfully retrieve?"
- Focus: Coverage of the positive class. High recall means the model misses few true matches.
- Critical For: Tasks where missing a true match is costly, such as fraud detection (missing a fraudulent transaction) or medical diagnosis.
- Formula: TP / (TP + FN)
F1 Score
The F1 Score is the harmonic mean of Precision and Recall. It provides a single metric that balances the trade-off between them.
- Use Case: The preferred metric when you need a single number to compare models, especially with imbalanced class distributions. It penalizes models that are strong in one metric (e.g., high precision) but weak in the other (e.g., low recall).
- Interpretation: An F1 score of 1 represents perfect precision and recall, while 0 represents the worst.
- Formula: 2 * (Precision * Recall) / (Precision + Recall)
Specificity & False Positive Rate
Specificity (True Negative Rate) measures the proportion of actual negatives correctly identified. False Positive Rate (FPR) is its complement (1 - Specificity).
- Specificity: Answers "Of all the true non-matches, what fraction did the model correctly leave unlinked?" Crucial for understanding how well the model avoids creating false links.
- False Positive Rate: The probability that a true negative is incorrectly classified as positive. This is critical for evaluating the operational burden of a system—a high FPR means many record pairs require manual review.
- Formulas:
- Specificity: TN / (TN + FP)
- FPR: FP / (FP + TN)
ROC-AUC & Precision-Recall AUC
ROC-AUC (Receiver Operating Characteristic - Area Under Curve) evaluates the model's performance across all classification thresholds. It plots the True Positive Rate (Recall) against the False Positive Rate.
- ROC-AUC Interpretation: A value of 0.5 indicates a random classifier; 1.0 indicates a perfect classifier. Useful for comparing models on balanced datasets.
Precision-Recall AUC plots Precision against Recall and is often more informative for imbalanced datasets common in entity resolution (where true matches are rare). It focuses directly on the performance of the positive class.
Application in Entity Resolution
A confusion matrix is a fundamental tool for evaluating the classification performance of an entity resolution system, quantifying its successes and errors in linking records.
In entity resolution, a confusion matrix is a 2x2 table that categorizes the outcomes of a pairwise matching decision between two records. It counts True Positives (TP), correctly linked matches; False Positives (FP), incorrectly linked non-matches; True Negatives (TN), correctly separated non-matches; and False Negatives (FN), missed matches. This structured breakdown is the basis for calculating core performance metrics like precision and recall, which trade off linkage accuracy against completeness.
The matrix provides actionable diagnostics beyond aggregate scores. A high FP rate indicates an overly permissive model creating false merges, while a high FN rate suggests a conservative model missing valid links. Analyzing these cells guides the tuning of similarity thresholds, blocking strategies, and feature engineering. For probabilistic and machine learning-based resolution systems, the confusion matrix is essential for model validation and for estimating the Fellegi-Sunter model parameters that define match and non-match probabilities.
Frequently Asked Questions
A confusion matrix is the fundamental diagnostic tool for evaluating classification models, including those used in entity resolution. This table provides a granular breakdown of prediction outcomes, enabling precise calculation of performance metrics.
A confusion matrix is a tabular layout used to visualize the performance of a classification algorithm by comparing its predicted labels against the true, ground-truth labels. It works by categorizing every prediction into one of four core outcomes for a binary classification problem: True Positives (TP), False Positives (FP), True Negatives (TN), and False Negatives (FN). The rows typically represent the actual class, while the columns represent the predicted class. By counting instances into these cells, the matrix provides a complete picture of where the model succeeds and where it makes errors, forming the basis for all subsequent performance metrics like accuracy, precision, and recall.
For example, in an entity resolution task to identify duplicate customer records, a 'match' is the positive class. A True Positive is correctly identifying two records as belonging to the same person. A False Positive is incorrectly linking two different people's records (a false match). A True Negative is correctly determining two records are different people. A False Negative is failing to link two records that are actually the same person (a missed match).
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
A confusion matrix is the foundational table for calculating key performance metrics in classification tasks like entity resolution. These related terms quantify the accuracy, errors, and trade-offs of a matching system.
Precision
Precision measures the correctness of a system's positive predictions. For entity resolution, it answers: 'Of all the record pairs the system linked as matches, what proportion were actually matches?'
- Formula: Precision = True Positives / (True Positives + False Positives)
- High Precision indicates a low rate of false merges, meaning the system is conservative and makes few incorrect linkage decisions. This is critical in domains like healthcare or finance where merging incorrect records has severe consequences.
- Trade-off: Often inversely related to Recall. A system can achieve 100% precision by only linking pairs it is absolutely certain about, but this would miss many true matches.
Recall
Recall (or Sensitivity) measures the system's ability to find all the actual matches. It answers: 'Of all the true matching record pairs that exist, what proportion did the system successfully retrieve?'
- Formula: Recall = True Positives / (True Positives + False Negatives)
- High Recall indicates a low rate of missed matches, meaning the system is comprehensive. This is vital for tasks like customer deduplication where missing a duplicate can lead to operational inefficiencies.
- Trade-off: A system can achieve 100% recall by linking every possible pair, but this would create a massive number of false merges, destroying precision.
F1-Score
The F1-Score is the harmonic mean of Precision and Recall, providing a single metric that balances both concerns. It is especially useful when you need a single number to compare models and when there is an uneven class distribution.
- Formula: F1-Score = 2 * (Precision * Recall) / (Precision + Recall)
- Interpretation: The F1-Score ranges from 0 to 1, where 1 represents perfect precision and recall. It penalizes extreme values in either metric. A model with high precision but low recall (or vice versa) will have a middling F1-Score.
- Use Case: The standard F1-Score weighs precision and recall equally. Variants like Fβ-Score allow you to weight recall (β > 1) or precision (β < 1) as more important for your specific business objective.
Accuracy
Accuracy is the proportion of all predictions (both positive and negative) that are correct. It is the most intuitive but often misleading metric for imbalanced classification tasks like entity resolution.
- Formula: Accuracy = (True Positives + True Negatives) / Total Predictions
- Pitfall in ER: In a typical entity resolution task, the number of non-matching pairs (True Negatives) is astronomically larger than the number of matching pairs. A naive system that simply declares everything a non-match could achieve 99.99% accuracy while being completely useless, as it would have 0% recall.
- When to Use: Accuracy is a valid metric only when the class distribution (matches vs. non-matches) is roughly balanced, which is rare in real-world ER scenarios.
False Positive Rate (FPR)
The False Positive Rate measures how often the system incorrectly labels a non-match as a match. It is a key metric for understanding the cost of errors in systems where false merges are expensive.
- Formula: FPR = False Positives / (False Positives + True Negatives)
- Context: In the confusion matrix, it is the proportion of all actual negatives that were incorrectly classified as positive. A low FPR is synonymous with high specificity.
- Business Impact: A high FPR in entity resolution means operational clean-up is required to undo incorrect merges, which can be labor-intensive and damage data integrity.
Receiver Operating Characteristic (ROC) Curve
A ROC Curve is a graphical plot that illustrates the diagnostic ability of a binary classifier system (like an entity resolution matcher) as its discrimination threshold is varied. It plots the True Positive Rate (Recall) against the False Positive Rate at various threshold settings.
- Key Element: The Area Under the Curve (AUC) summarizes the curve's information into a single value between 0 and 1. An AUC of 1.0 represents a perfect classifier; 0.5 represents a classifier no better than random guessing.
- Use in ER: By analyzing the ROC curve, engineers can select the optimal threshold for their matching model based on the business's tolerance for false positives versus false negatives. It shows the full trade-off space between recall and FPR.

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