Is there a built-in way for getting accuracy scores for each class separatetly? I know in sklearn we can get overall accuracy by using metric.accuracy_score. Is
metric.accuracy_score
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)