Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

accuracy for each class


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 codefantasy.org #
 
PREVIOUS NEXT
Tagged: #accuracy #class
ADD COMMENT
Topic
Name
7+3 =