Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

mean class accuracy sklearn

from sklearn.metrics import confusion_matrix
y_true = [2, 0, 2, 2, 0, 1]
y_pred = [0, 0, 2, 2, 0, 2]
matrix = confusion_matrix(y_true, y_pred)
matrix.diagonal()/matrix.sum(axis=1)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #class #accuracy #sklearn
ADD COMMENT
Topic
Name
9+7 =