« Back to Glossary Index

The confusion matrix is a table used to measure the error rate of classification models. It is a square matrix, i.e. it has the same number of rows and columns, which depends on the number of classes. The rows indicate the actual classes, while the columns indicate the predicted classes. Based on the values within each cell, it is possible to calculate standard metrics for evaluating classification models, such as the true positive rate, false positive rate, true negative rate and false negative rate. From these four measures, metrics such as accuracy, precision, recall and F1-score can also be derived.