What is the main purpose of building a confusion matrix after evaluating a classifier on a test set?
Select an answer to reveal the explanation.
Short Explanation and Infographic
A confusion matrix is basically a report card laid out as a grid: actual classes down one side, predicted classes across the other, and every cell shows how many test examples fell into that actual-versus-predicted combination. Its job is a detailed, honest summary of how the classifier performed — not just a single number like accuracy, but a full breakdown of which classes get correctly identified and which get mixed up. That's answer A. It's not something that adjusts weights itself — that's the optimizer's job during training, this is purely an evaluation tool built after predictions are made. It has nothing to do with a learning rate schedule, that's a separate hyperparameter decision. And it doesn't tell you how many layers to add — that's a modeling call based on other diagnostics, not the matrix itself.
Full explanation below image
Full Explanation
A confusion matrix is a tabular summary that cross-tabulates a classifier's predicted labels against the true labels for a set of evaluated examples, typically with actual classes as rows and predicted classes as columns. Its main purpose is to give a detailed, class-by-class breakdown of classifier performance that goes far beyond what a single aggregate metric like accuracy can reveal: the diagonal cells show correct predictions per class, while the off-diagonal cells show specifically which classes are being confused with which other classes, and in what quantities. From this matrix, other important metrics such as precision, recall, specificity, and F1 score can also be directly computed for each class, making the confusion matrix a foundational diagnostic tool for understanding a model's error patterns after evaluation.
Automatically adjusting the model's weights to reduce future errors is incorrect because that is the role of the training process itself — specifically backpropagation combined with an optimizer such as SGD or Adam, which update weights based on computed gradients during training; a confusion matrix is constructed after predictions have already been made on a fixed set of examples and has no mechanism to modify weights on its own. Calculating the learning rate schedule for the next round of training is incorrect because a learning rate schedule is a training hyperparameter configuration, decided and adjusted independently by the practitioner or by a scheduling algorithm; the confusion matrix contains no information about learning rates and is not used to derive one. Determining how many layers should be added to improve the architecture is incorrect because architectural decisions like depth are typically informed by broader diagnostics such as comparing training versus validation loss curves to detect underfitting or overfitting, or by systematic architecture search; while a confusion matrix's error patterns might indirectly motivate an architecture change, generating a layer count is not its defined purpose or output.
In practice, a confusion matrix is most valuable precisely because it exposes error patterns hidden by aggregate metrics — for example, it can reveal that a classifier reliably distinguishes most classes well but consistently confuses two visually or semantically similar classes with each other, information that would be completely invisible from an overall accuracy score alone, and that can directly guide targeted improvements such as gathering more training data for the confused classes or adjusting the decision threshold.