8.16.1.1. sklearn.metrics.confusion_matrix¶
- sklearn.metrics.confusion_matrix(y_true, y_pred, labels=None)¶
Compute confusion matrix to evaluate the accuracy of a classification
By definition a confusion matrix cm is such that cm[i, j] is equal to the number of observations known to be in group i but predicted to be in group j
Parameters : y_true : array, shape = [n_samples]
true targets
y_pred : array, shape = [n_samples]
estimated targets
Returns : CM : array, shape = [n_classes, n_classes]
confusion matrix
Notes
References: http://en.wikipedia.org/wiki/Confusion_matrix