mlPopular Client-Side Only

Confusion Matrix & ML Metrics Calculator

Input True Positives, False Positives, True Negatives, and False Negatives to instantly compute Accuracy, Precision, Recall, and F1-Score.

Concept Breakdown: Supervised vs Unsupervised Model Training

1. The Hiker in Fog (Gradient Descent)

Imagine you are hiking down a mountain in pitch-black fog. You feel the slope with your feet and step downward. Gradient Descent does this mathematically — taking steps downhill until reaching the valley floor of lowest error.

2. Measuring Mistakes (Confusion Matrix)

When an AI spots spam emails, it can make two mistakes: letting spam through (False Negative) or blocking a real email (False Positive). A Confusion Matrix tracks these tradeoffs.

3. Try Rolling the Ball!

Click "Step (1 Iteration)" below. Watch the ball take mathematical steps down the parabolic curve until it settles comfortably at the bottom minimum!

Confusion Matrix Inputs (Counts):
True Positives (TP)Correctly detected positive
False Positives (FP)Type I error (False alarm)
False Negatives (FN)Type II error (Missed case)
True Negatives (TN)Correctly rejected negative
ACCURACY87.5%(TP + TN) / Total
PRECISION85.0%TP / (TP + FP)
RECALL (SENSITIVITY)89.5%TP / (TP + FN)
F1-SCORE87.2%Harmonic Mean

Quick Reference & Instructions

Simple steps, pro tips, and execution details

1

Provide Inputs

Type, paste, or select your values in the form fields below.

2

Instant Live Analysis

Calculations and formatting happen automatically with zero delay as you type.

3

Copy or Use Output

Copy results or apply the clean output directly to your projects.

How It Works

Computes complete binary classification metrics including Specificity, Balanced Accuracy, and Matthew's Correlation Coefficient (MCC).

Formula & Logic

Accuracy=TP+TNTP+TN+FP+FN,F1=2×Precision×RecallPrecision+Recall\text{Accuracy} = \frac{TP+TN}{TP+TN+FP+FN}, \quad \text{F1} = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}}
Example: TP=80, FP=20, FN=10, TN=90 yields Accuracy 85%, Precision 80%, Recall 88.9%, and F1 84.2%.

Frequently Asked Questions

Common questions about calculations, assumptions, and edge cases.

Yes, Confusion Matrix & ML Metrics Calculator is 100% free with unlimited calculations and zero paywalls or subscriptions.