How do you derive accuracy, precision, and recall from a confusion matrix?

Quick Overview

Asks how to compute accuracy, precision and recall from the four cells of a binary confusion matrix, with a worked example. Tests whether you know which cells each metric uses, why accuracy can mislead on imbalanced data, and how the metrics extend to multiclass problems.

How do you derive accuracy, precision, and recall from a confusion matrix?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

How do you derive accuracy, precision, and recall from a confusion matrix? ```hint Fix the layout first Decide which axis of the matrix holds the actual labels and which holds the predictions, then ask which cells each metric's denominator should include. ``` ### What a Strong Answer Covers - The four cells of a binary confusion matrix and what each one means. - The formula for each metric and which row or column its denominator uses. - A numeric example, and why accuracy can look high on imbalanced data. - How the metrics extend to more than two classes. ### Follow-up Questions - Using the same counts, what are the F1 score and the false positive rate? - How do micro and macro averaging differ, and when does the choice change the conclusion? - If you lower the classification threshold, how do the cells move, and what happens to precision and recall?

Overview: Asks how to compute accuracy, precision and recall from the four cells of a binary confusion matrix, with a worked example. Tests whether you know which cells each metric uses, why accuracy can mislead on imbalanced data, and how the metrics extend to multiclass problems.

PracHub logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

How do you derive accuracy, precision, and recall from a confusion matrix?

What a Strong Answer Covers Guidance

  • The four cells of a binary confusion matrix and what each one means.
  • The formula for each metric and which row or column its denominator uses.
  • A numeric example, and why accuracy can look high on imbalanced data.
  • How the metrics extend to more than two classes.

Follow-up Questions Guidance

  • Using the same counts, what are the F1 score and the false positive rate?
  • How do micro and macro averaging differ, and when does the choice change the conclusion?
  • If you lower the classification threshold, how do the cells move, and what happens to precision and recall?