Skip to content
Query Feedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  1. Home /
  2. AI Glossaries /
  3. Machine Learning /
  4. What is a Confusion Matrix?
Machine Learning

What is a Confusion Matrix?

Updated October 2, 2026 Read 3 min

A confusion matrix is a table showing how a classification model's predictions compare with the true labels, breaking results into true positives, false positives, true negatives and false negatives.

Contents 11
  1. 01Key takeaways
  2. 02The four outcomes
  3. 03A worked example
  4. 04Turning cells into business decisions
  5. 05Multi-class confusion matrices
  6. 06Thresholds and the matrix
  7. 07Practical guidance
  8. 08Limitations
  9. 09Common Use Cases
  10. 10Frequently Asked Questions
  11. 11Related Terms

A confusion matrix is a table showing how a classification model’s predictions compare with the true labels. For a binary problem it has four cells: true positives, false positives, true negatives and false negatives. Nearly every classification metric, including precision, recall and F1, is derived from these four numbers, which is why reading a confusion matrix is the foundation of evaluating a classifier.

Key takeaways

  • The four cells distinguish which kind of error a model makes, not just how many.
  • Accuracy alone hides the difference between false positives and false negatives.
  • The matrix changes with the decision threshold, so it describes one operating point.
  • For multi-class problems it becomes an n × n grid showing which classes get confused.
  • Business impact depends on the cost of each error type, which the matrix makes visible.

The four outcomes

Predicted positivePredicted negative
Actually positiveTrue positive (TP): correctly caughtFalse negative (FN): missed
Actually negativeFalse positive (FP): false alarmTrue negative (TN): correctly ignored

In statistics, a false positive is a Type I error and a false negative a Type II error.

A worked example

A fraud model is evaluated on 10,000 transactions, of which 200 are genuinely fraudulent.

Predicted fraudPredicted legitimate
Actually fraudTP = 150FN = 50
Actually legitimateFP = 300TN = 9,500

From these four numbers:

  • Accuracy = (150 + 9,500) ÷ 10,000 = 96.5%
  • Precision = 150 ÷ (150 + 300) = 33.3%
  • Recall = 150 ÷ (150 + 50) = 75%
  • Specificity = 9,500 ÷ (9,500 + 300) = 96.9%
  • F1 = 2 × (0.333 × 0.75) ÷ (0.333 + 0.75) = 0.46

Accuracy of 96.5% sounds excellent. The matrix tells the real story: only a third of flagged transactions are actually fraud, and a quarter of real fraud is missed. A model predicting “legitimate” always would score 98% accuracy and catch nothing.

Turning cells into business decisions

Attach a cost to each error type:

OutcomeBusiness consequenceEstimated cost
TPFraud stoppedSaves ₹8,000 on average
FPGenuine customer blocked₹500 in support and goodwill
FNFraud succeeds₹8,000 loss
TNNormal transaction₹0

With these numbers: value = (150 × 8,000) − (300 × 500) − (50 × 8,000) = ₹1,200,000 − ₹150,000 − ₹400,000 = ₹650,000 saved. Lowering the threshold would catch more fraud but create more false alarms; the matrix plus costs tells you whether that trade is worth making.

Multi-class confusion matrices

For n classes, the matrix is n × n, with rows as true classes and columns as predictions. The diagonal holds correct predictions; everything off-diagonal shows which classes get mixed up. This is diagnostically rich: discovering that “billing” tickets are mostly misclassified as “account” tells you exactly where to improve guidelines or training data.

Thresholds and the matrix

A classifier outputs probabilities; a threshold turns them into decisions. Every threshold produces a different confusion matrix:

ThresholdTPFPFNEffect
0.318070020Catches more, more false alarms
0.515030050Balanced
0.89060110Few false alarms, misses much fraud

Choosing the threshold is a business decision, informed by these numbers rather than by a single metric.

Practical guidance

  • Always inspect the matrix, not just headline accuracy.
  • Report absolute counts alongside percentages so rare classes are visible.
  • Produce separate matrices for important subgroups to check for bias.
  • Normalise by row to see per-class recall, by column to see per-class precision.
  • Re-evaluate after deployment, since class balance shifts over time.

Limitations

  • Describes a single threshold, not overall ranking quality.
  • Large multi-class matrices are hard to read without visualisation.
  • Says nothing about confidence calibration.
  • Needs reliable ground-truth labels, which can themselves be wrong.

Common Use Cases

01

Fraud detection

Weigh missed fraud against false alarms.

02

Medical screening

Prioritise recall where missed cases are dangerous.

03

Spam filtering

Keep false positives extremely low.

04

Support ticket routing

See which categories get confused with which.

05

Threshold selection

Choose an operating point using error costs.

06

Fairness auditing

Compare error types across demographic groups.

Frequently Asked Questions

A table comparing predicted and actual labels, showing true positives, false positives, true negatives and false negatives.

Accuracy treats all errors alike and can look high while the model misses every rare case.

A case the model flags as positive that is actually negative, also called a Type I error.

Rows are true classes, columns are predictions. The diagonal is correct; off-diagonal cells show which classes are confused.

Yes. Each decision threshold produces a different matrix, which is why thresholds should be chosen deliberately.

Related Terms

  • Precision and Recall
  • F1 Score
  • Classification
  • AI Classification
  • Model Evaluation
  • AI Bias

Related AI Terms

What is Hyperparameter Tuning?Hyperparameter tuning is the process of systematically searching for the configuration values that make a model perform best…What is L2 Regularization?L2 regularization adds a penalty equal to the sum of the squared weights, shrinking all weights smoothly towards…What is L1 Regularization?L1 regularization, known as lasso in linear models, adds a penalty equal to the sum of the absolute…What is Cross-Validation in Machine Learning?Cross-validation is a technique that repeatedly splits data into training and validation parts, rotating which part is held…What is Stochastic Gradient Descent (SGD)?Stochastic gradient descent (SGD) updates a model's weights using one example or a small batch at a time…What is the Bias-Variance Tradeoff?The bias-variance tradeoff describes how a model's error splits into bias from overly simple assumptions and variance from…

Contents

  1. 01Key takeaways
  2. 02The four outcomes
  3. 03A worked example
  4. 04Turning cells into business decisions
  5. 05Multi-class confusion matrices
  6. 06Thresholds and the matrix
  7. 07Practical guidance
  8. 08Limitations
  9. 09Common Use Cases
  10. 10Frequently Asked Questions
  11. 11Related Terms

AI Topic

  • Machine Learning

Related Terms

  • What is Hyperparameter Tuning?
  • What is L2 Regularization?
  • What is L1 Regularization?
  • What is Cross-Validation in Machine Learning?
  • What is Stochastic Gradient Descent (SGD)?
  • What is the Bias-Variance Tradeoff?

Quick Navigation

  • Common Use Cases
  • Frequently Asked Questions
  • Related Terms
  • Back to top

Details

Updated
October 2, 2026
Read
3 min
  • Forum
  • Submit a tool
  • Submit Guest Post
  • List Your Startup
  • Privacy Policy
  • Editorial Policy
  • Account
  • Contact
  • AI Productivity
  • AI Video
  • AI Coding
  • AI Chatbots
  • Sales
  • AI Business
  • View All Tools

Subscribe our Newsletter

Get weekly exclusive content - No spam.

Copyright © 2026 -  Query Feedz

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}