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: Plots a confusion matrix for the evaluation results.
  
  If you are working in a notebook environment with the default plotly
  backend, this method returns an interactive
  :class:`fiftyone.core.plots.plotly.InteractiveHeatmap` that you can
  attach to an App session via its
  :attr:`fiftyone.core.session.Session.plots` attribute, which will
  automatically sync the session's view with the currently selected cells
  in the confusion matrix.
  
  Args:
      classes (None): an optional list of classes to include in the
          confusion matrix
      include_other (None): whether to include a row/column for examples
          whose label is in ``classes`` but are matched to labels that
          do not appear in ``classes``. Only applicable if ``classes``
          are provided. The supported values are:
  
          -   None (default): only include a row/column for other labels
              if there are any
          -   True: do include a row/column for other labels
          -   False: do not include a row/column for other labels
      include_missing (None): whether to include a row/column for missing
          ground truth/predictions in the confusion matrix. The supported
          values are:
  
          -   None (default): only include a row/column for missing
              labels if there are any
          -   True: do include a row/column for missing labels
          -   False: do not include a row/column for missing labels
      other_label ("(other)"): the label to use for "other" predictions
      backend ("plotly"): the plotting backend to use. Supported values
          are ``("plotly", "matplotlib")``
      **kwargs: keyword arguments for the backend plotting method:
  
          -   "plotly" backend: :meth:`fiftyone.core.plots.plotly.plot_confusion_matrix`
          -   "matplotlib" backend: :meth:`fiftyone.core.plots.matplotlib.plot_confusion_matrix`
  
  Returns:
      one of the following:
  
      -   a :class:`fiftyone.core.plots.plotly.InteractiveHeatmap`, if
          the plotly backend is used
      -   a matplotlib figure, otherwise
docstr_tok: ["Plots","a","confusion","matrix","for","the","evaluation","results",".","If","you","are","working","in","a","notebook","environment","with","the","default","plotly","backend",",","this","method","returns","an","interactive",":","class",":","`","fiftyone.core.plots.plotly.InteractiveHeatmap","`","that","you","can","attach","to","an","App","session","via","its",":","attr",":","`","fiftyone.core.session.Session.plots","`","attribute",",","which","will","automatically","sync","the","session","'s","view","with","the","currently","selected","cells","in","the","confusion","matrix",".","Args",":","classes","(","None",")",":","an","optional","list","of","classes","to","include","in","the","confusion","matrix","include_other","(","None",")",":","whether","to","include","a","row\/column","for","examples","whose","label","is","in","``","classes","``","but","are","matched","to","labels","that","do","not","appear","in","``","classes","``",".","Only","applicable","if","``","classes","``","are","provided",".","The","supported","values","are",":","-","None","(","default",")",":","only","include","a","row\/column","for","other","labels","if","there","are","any","-","True",":","do","include","a","row\/column","for","other","labels","-","False",":","do","not","include","a","row\/column","for","other","labels","include_missing","(","None",")",":","whether","to","include","a","row\/column","for","missing","ground","truth\/predictions","in","the","confusion","matrix",".","The","supported","values","are",":","-","None","(","default",")",":","only","include","a","row\/column","for","missing","labels","if","there","are","any","-","True",":","do","include","a","row\/column","for","missing","labels","-","False",":","do","not","include","a","row\/column","for","missing","labels","other_label","(","``","(","other",")","''",")",":","the","label","to","use","for","``","other","''","predictions","backend","(","``","plotly","''",")",":","the","plotting","backend","to","use",".","Supported","values","are","``","(","``","plotly","''",",","``","matplotlib","''",")","``","*","*","kwargs",":","keyword","arguments","for","the","backend","plotting","method",":","-","``","plotly","''","backend",":",":","meth",":","`","fiftyone.core.plots.plotly.plot_confusion_matrix","`","-","``","matplotlib","''","backend",":",":","meth",":","`","fiftyone.core.plots.matplotlib.plot_confusion_matrix","`","Returns",":","one","of","the","following",":","-","a",":","class",":","`","fiftyone.core.plots.plotly.InteractiveHeatmap","`",",","if","the","plotly","backend","is","used","-","a","matplotlib","figure",",","otherwise"]
code: def plot_confusion_matrix(
      self,
      classes=None,
      include_other=None,
      include_missing=None,
      other_label="(other)",
      backend="plotly",
      **kwargs,
  ):
      """Plots a confusion matrix for the evaluation results.
  
      If you are working in a notebook environment with the default plotly
      backend, this method returns an interactive
      :class:`fiftyone.core.plots.plotly.InteractiveHeatmap` that you can
      attach to an App session via its
      :attr:`fiftyone.core.session.Session.plots` attribute, which will
      automatically sync the session's view with the currently selected cells
      in the confusion matrix.
  
      Args:
          classes (None): an optional list of classes to include in the
              confusion matrix
          include_other (None): whether to include a row/column for examples
              whose label is in ``classes`` but are matched to labels that
              do not appear in ``classes``. Only applicable if ``classes``
              are provided. The supported values are:
  
              -   None (default): only include a row/column for other labels
                  if there are any
              -   True: do include a row/column for other labels
              -   False: do not include a row/column for other labels
          include_missing (None): whether to include a row/column for missing
              ground truth/predictions in the confusion matrix. The supported
              values are:
  
              -   None (default): only include a row/column for missing
                  labels if there are any
              -   True: do include a row/column for missing labels
              -   False: do not include a row/column for missing labels
          other_label ("(other)"): the label to use for "other" predictions
          backend ("plotly"): the plotting backend to use. Supported values
              are ``("plotly", "matplotlib")``
          **kwargs: keyword arguments for the backend plotting method:
  
              -   "plotly" backend: :meth:`fiftyone.core.plots.plotly.plot_confusion_matrix`
              -   "matplotlib" backend: :meth:`fiftyone.core.plots.matplotlib.plot_confusion_matrix`
  
      Returns:
          one of the following:
  
          -   a :class:`fiftyone.core.plots.plotly.InteractiveHeatmap`, if
              the plotly backend is used
          -   a matplotlib figure, otherwise
      """
      confusion_matrix, labels, ids = self._confusion_matrix(
          classes=classes,
          include_other=include_other,
          include_missing=include_missing,
          other_label=other_label,
          tabulate_ids=True,
      )
  
      return fop.plot_confusion_matrix(
          confusion_matrix,
          labels,
          ids=ids,
          samples=self.samples,
          eval_key=self.key,
          gt_field=self.config.gt_field,
          pred_field=self.config.pred_field,
          backend=backend,
          **kwargs,
      )
  
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 6 for calling the BaseEvaluationResults obj's underlying member method code with example usage: obj.plot_confusion_matrix(classes, include_other, include_missing, other_label, backend) and returns: fop