y_pred = self.label_encoder.inverse_transform(y_pred)
except AttributeError:
// if a mapping is passed to class apply it here.
y = np.array([self.label_encoder[x] for x in y])
y_pred = np.array([self.label_encoder[x] for x in y_pred])
// Compute the confusion matrix and class counts
self.confusion_matrix_ = confusion_matrix_metric(
After Change
Global accuracy score
// Call super to check if fitted and to compute self.score_
super(ConfusionMatrix, self).score(X, y)
// Create predictions from X (will raise not fitted error)
y_pred = self.predict(X)