ML
    beginner

    Confusion Matrix & Metrics

    algorithms.live

    Confusion Matrix Visualizer
    balanced

    Configuration

    Matrix Values

    85
    90
    10
    15

    Total Samples:

    200

    Confusion Matrix

    2×2 Classification Outcomes

    Predicted Positive
    Predicted Negative
    Actual Positive
    85
    True Positive
    42.5%
    15
    False Negative
    7.5%
    Actual Negative
    10
    False Positive
    5.0%
    90
    True Negative
    45.0%
    Accuracy
    87.50%
    (TP + TN) / Total
    Precision
    89.47%
    TP / (TP + FP)
    Recall
    85.00%
    TP / (TP + FN)
    F1-Score
    87.18%
    2 × (P × R) / (P + R)
    Specificity
    90.00%
    TN / (TN + FP)
    False Positive Rate
    10.00%
    FP / (FP + TN)

    Scenario Interpretation

    Balanced dataset with good performance. Precision and recall are similar, indicating no major bias toward either class. This is the ideal scenario.

    Precision-Recall Trade-off

    Cannot maximize both simultaneously. Precision focuses on minimizing false alarms (FP). Recall focuses on catching all positives (FN).

    Accuracy Paradox

    High accuracy can be misleading with imbalanced data. A model always predicting the majority class gets high accuracy but is useless.

    F1-Score Balance

    Harmonic mean of precision and recall. Best for imbalanced datasets. Provides a single metric combining both false positive and false negative costs.

    Label the confusion matrix

    Schematic

    Fill in the four cells for a positive class of "has the disease".

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    predicted +, actually +
    predicted +, actually −
    predicted −, actually +
    predicted −, actually −
    4 pieces left to place

    Test your knowledge

    22 questions
    Question 1 of 22
    Score: 0

    Which metric is best when False Negatives are very costly (e.g., detecting a disease)?

    Interview Questions

    Google Health
    Tempus
    Flatiron
    Stripe
    Intuit
    Mastercard
    Google
    Microsoft
    Apple
    Amazon
    Tesla
    Waymo

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required