a matrix showing the predicted and actual classifications
Measures the correctness of predictions made by a model. The row indexes of a confusion matrix correspond to actual values observed and used for model building; the column indexes correspond to predicted values produced by applying the model. For any pair of actual/predicted indexes, the value indicates the number of records classified in that pairing. cost matrix A two-dimensional, by table that defines the cost associated with a prediction versus the actual value. A cost matrix is typically used in classification models, where is the number of distinct values in the target, and the columns and rows are labeled with target values.
Measures the correctness of predictions made by a model from a test task. The row indexes of a confusion matrix correspond to actual values observed and provided in the test data. These were used for model building. The column indexes correspond to predicted values produced by applying the model to the test data. For any pair of actual/predicted indexes, the value indicates the number of records classified in that pairing. When predicted value equals actual value, the model produces correct predictions. All other entries indicate errors.
A confusion matrix shows the counts of the actual versus predicted class values. It shows not only how well the model predicts, but also presents the details needed to see exactly where things may have gone wrong.
In the field of artificial intelligence, a confusion matrix is a visualization tool typically used in supervised learning (in unsupervised learning it is typically called a matching matrix). Each column of the matrix represents the instances in a predicted class, while each row represents the instances in an actual class. One benefit of a confusion matrix is that it is easy to see if the system is confusing two classes (i.e. commonly mislabelling one as an other).