code: def get_per_class_matrix(y, classes=None):
      """
      Create a (num_classes x num_examples) binary matrix representation of the
      true and predicted y values.
      If classes is None, class values will be extracted from y. Values that are
      not present at all will not receive a column -- this is to allow computation
      of per-class roc_auc scores without error.
      """
      classes = classes or np.unique(y)
      y_bin = np.zeros((len(y), len(classes)))
      for i, cls in enumerate(classes):
          y_bin[:, i] = (y == cls).astype(int)
      return y_bin
  
file_path: ATM/atm/metrics.py
imports: from __future__ import absolute_import, division, unicode_literals
  from builtins import range
  import numpy
  import pandas
  from sklearn.metrics import accuracy_score, average_precision_score, cohen_kappa_score, f1_score, matthews_corrcoef, precision_recall_curve, roc_auc_score, roc_curve
  from sklearn.model_selection import StratifiedKFold
  from atm.constants import METRICS_BINARY, METRICS_MULTICLASS, N_FOLDS_DEFAULT, Metrics
label_desc: Use image node_id 2 for calling a global function with example usage: get_per_class_matrix(y, classes) and returns: y_bin