A confusion matrix is a table that cross-tabulates actual classes against predicted classes, and it extends naturally to any number of categories. For an algorithm with N classes it takes the form of an N-by-N grid in which the diagonal holds correct predictions and the off-diagonal cells show which classes are being mistaken for which. From it, a data scientist derives overall accuracy and per-class precision, recall, and F1-score, and can spot systematic confusion between particular pairs of classes. That diagnostic detail is what makes it the best choice for verifying accuracy in a multi-class setting, where a single accuracy percentage can conceal poor performance on smaller classes.
Linear regression is a modeling technique that predicts continuous numeric values. It is not an evaluation method, and it does not assess the correctness of class assignments.
K-nearest neighbors is itself a classification algorithm that labels a record based on the classes of its closest training examples. It produces predictions and therefore requires evaluation; it is not the tool used to evaluate them.
The question asks for a verification technique, and only the confusion matrix serves that role. It is a standard component of model validation, typically computed on held-out test data.
[References:AI Concepts: Model Evaluation Metrics (Confusion Matrix, Accuracy, Precision, Recall).]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit