class_docstr: Base class for evaluation results.
  
  Args:
      samples: the :class:`fiftyone.core.collections.SampleCollection` used
      config: the :class:`fiftyone.core.evaluation.EvaluationMethodConfig`
          used
      eval_key: the evaluation key
      ytrue: a list of ground truth labels
      ypred: a list of predicted labels
      confs (None): an optional list of confidences for the predictions
      weights (None): an optional list of sample weights
      ytrue_ids (None): a list of IDs for the ground truth labels
      ypred_ids (None): a list of IDs for the predicted labels
      classes (None): the list of possible classes. If not provided, the
          observed ground truth/predicted labels are used
      missing (None): a missing label string. Any None-valued labels are
          given this label for evaluation purposes
      samples (None): the :class:`fiftyone.core.collections.SampleCollection`
          for which the results were computed
      backend (None): a :class:`fiftyone.core.evaluation.EvaluationMethod`
          backend
class_docstr_tok: ["Base","class","for","evaluation","results",".","Args",":","samples",":","the",":","class",":","`","fiftyone.core.collections.SampleCollection","`","used","config",":","the",":","class",":","`","fiftyone.core.evaluation.EvaluationMethodConfig","`","used","eval_key",":","the","evaluation","key","ytrue",":","a","list","of","ground","truth","labels","ypred",":","a","list","of","predicted","labels","confs","(","None",")",":","an","optional","list","of","confidences","for","the","predictions","weights","(","None",")",":","an","optional","list","of","sample","weights","ytrue_ids","(","None",")",":","a","list","of","IDs","for","the","ground","truth","labels","ypred_ids","(","None",")",":","a","list","of","IDs","for","the","predicted","labels","classes","(","None",")",":","the","list","of","possible","classes",".","If","not","provided",",","the","observed","ground","truth\/predicted","labels","are","used","missing","(","None",")",":","a","missing","label","string",".","Any","None-valued","labels","are","given","this","label","for","evaluation","purposes","samples","(","None",")",":","the",":","class",":","`","fiftyone.core.collections.SampleCollection","`","for","which","the","results","were","computed","backend","(","None",")",":","a",":","class",":","`","fiftyone.core.evaluation.EvaluationMethod","`","backend"]
code: def _confusion_matrix(
      self,
      classes=None,
      include_other=None,
      include_missing=None,
      other_label=None,
      tabulate_ids=False,
  ):
      if classes is not None:
          labels = list(classes)
      else:
          labels = list(self.classes)
          include_other = False
  
      if include_other != False and other_label not in labels:
          added_other = True
          labels.append(other_label)
      else:
          added_other = False
  
      if include_missing != False and self.missing not in labels:
          added_missing = True
          labels.append(self.missing)
      else:
          added_missing = False
  
      if include_other != False:
          labels_set = set(labels + [self.missing])
          ypred = [
              y if y in labels_set else other_label for y in self.ypred
          ]
          ytrue = [
              y if y in labels_set else other_label for y in self.ytrue
          ]
      else:
          ypred = self.ypred
          ytrue = self.ytrue
  
      cmat, ids = _compute_confusion_matrix(
          ytrue,
          ypred,
          labels,
          weights=self.weights,
          ytrue_ids=self.ytrue_ids,
          ypred_ids=self.ypred_ids,
          tabulate_ids=tabulate_ids,
      )
  
      if added_other:
          # Omit `(other, other)`
          i = labels.index(other_label)
          cmat[i, i] = 0
          ids[i, i] = []
  
          if added_missing:
              # Omit `(other, missing)` and `(missing, other)`
              j = labels.index(self.missing)
              cmat[i, j] = 0
              cmat[j, i] = 0
              ids[i, j] = []
              ids[j, i] = []
  
      rm_inds = []
  
      if include_other == None:
          idx = labels.index(other_label)
          if not any(cmat[:, idx]) and not any(cmat[idx, :]):
              rm_inds.append(idx)
  
      if include_missing == None:
          idx = labels.index(self.missing)
          if not any(cmat[:, idx]) and not any(cmat[idx, :]):
              rm_inds.append(idx)
  
      if rm_inds:
          cmat = np.delete(
              np.delete(cmat, rm_inds, axis=0), rm_inds, axis=1
          )
          ids = np.delete(
              np.delete(ids, rm_inds, axis=0), rm_inds, axis=1
          )
          labels = [l for i, l in enumerate(labels) if i not in rm_inds]
  
      return cmat, labels, ids
  
file_path: fiftyone/fiftyone/utils/eval/base.py
imports: import itertools
  import numpy
  import sklearn.metrics
  import fiftyone.core.evaluation
  import fiftyone.core.plots
label_desc: Use image node_id 8 for calling the BaseEvaluationResults obj's underlying member method code with example usage: obj._confusion_matrix(classes, include_other, include_missing, other_label, tabulate_ids) and returns: cmat,  labels,  ids