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"]
docstr: Generates a confusion matrix for the results via
  :func:`sklearn:sklearn.metrics.confusion_matrix`.
  
  The rows of the confusion matrix represent ground truth and the columns
  represent predictions.
  
  Args:
      classes (None): an optional list of classes to include in the
          confusion matrix. Include ``self.missing`` in this list if you
          would like to include a row/column for unmatched examples
      include_other (False): whether to include an extra row/column at
          the end of the matrix for labels that do not appear in
          ``classes``. Only applicable if ``classes`` are provided
  
  Returns:
      a ``num_classes x num_classes`` confusion matrix
docstr_tok: ["Generates","a","confusion","matrix","for","the","results","via",":","func",":","`","sklearn",":","sklearn.metrics.confusion_matrix","`",".","The","rows","of","the","confusion","matrix","represent","ground","truth","and","the","columns","represent","predictions",".","Args",":","classes","(","None",")",":","an","optional","list","of","classes","to","include","in","the","confusion","matrix",".","Include","``","self.missing","``","in","this","list","if","you","would","like","to","include","a","row\/column","for","unmatched","examples","include_other","(","False",")",":","whether","to","include","an","extra","row\/column","at","the","end","of","the","matrix","for","labels","that","do","not","appear","in","``","classes","``",".","Only","applicable","if","``","classes","``","are","provided","Returns",":","a","``","num_classes","x","num_classes","``","confusion","matrix"]
code: def confusion_matrix(self, classes=None, include_other=False):
      """Generates a confusion matrix for the results via
      :func:`sklearn:sklearn.metrics.confusion_matrix`.
  
      The rows of the confusion matrix represent ground truth and the columns
      represent predictions.
  
      Args:
          classes (None): an optional list of classes to include in the
              confusion matrix. Include ``self.missing`` in this list if you
              would like to include a row/column for unmatched examples
          include_other (False): whether to include an extra row/column at
              the end of the matrix for labels that do not appear in
              ``classes``. Only applicable if ``classes`` are provided
  
      Returns:
          a ``num_classes x num_classes`` confusion matrix
      """
      confusion_matrix, _, _ = self._confusion_matrix(
          classes=classes,
          include_other=include_other,
          include_missing=False,
      )
      return confusion_matrix
  
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 5 for calling the BaseEvaluationResults obj's underlying member method code with example usage: obj.confusion_matrix(classes, include_other) and returns: confusion_matrix