class_docstr: Class that stores the results of an Open Images detection evaluation.
  
  Args:
      samples: the :class:`fiftyone.core.collections.SampleCollection` used
      config: the :class:`OpenImagesEvaluationConfig` used
      eval_key: the evaluation key
      matches: a list of
          ``(gt_label, pred_label, iou, pred_confidence, gt_id, pred_id)``
          matches. Either label can be ``None`` to indicate an unmatched
          object
      precision: a dict of per-class precision values
      recall: a dict of per-class recall values
      classes: the list of possible classes
      thresholds (None): an optional dict of per-class decision thresholds
      missing (None): a missing label string. Any unmatched objects are
          given this label for evaluation purposes
      backend (None): a :class:`OpenImagesEvaluation` backend
class_docstr_tok: ["Class","that","stores","the","results","of","an","Open","Images","detection","evaluation",".","Args",":","samples",":","the",":","class",":","`","fiftyone.core.collections.SampleCollection","`","used","config",":","the",":","class",":","`","OpenImagesEvaluationConfig","`","used","eval_key",":","the","evaluation","key","matches",":","a","list","of","``","(","gt_label",",","pred_label",",","iou",",","pred_confidence",",","gt_id",",","pred_id",")","``","matches",".","Either","label","can","be","``","None","``","to","indicate","an","unmatched","object","precision",":","a","dict","of","per-class","precision","values","recall",":","a","dict","of","per-class","recall","values","classes",":","the","list","of","possible","classes","thresholds","(","None",")",":","an","optional","dict","of","per-class","decision","thresholds","missing","(","None",")",":","a","missing","label","string",".","Any","unmatched","objects","are","given","this","label","for","evaluation","purposes","backend","(","None",")",":","a",":","class",":","`","OpenImagesEvaluation","`","backend"]
docstr: Plots precision-recall (PR) curves for the detection results.
  
  Args:
      classes (None): a list of classes to generate curves for. By
          default, the top 3 AP classes will be plotted
      num_points (101): the number of linearly spaced recall values to
          plot
      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_pr_curves`
          -   "matplotlib" backend: :meth:`fiftyone.core.plots.matplotlib.plot_pr_curves`
  
  Returns:
      one of the following:
  
      -   a :class:`fiftyone.core.plots.plotly.PlotlyNotebookPlot`, if
          you are working in a notebook context and the plotly backend is
          used
      -   a plotly or matplotlib figure, otherwise
docstr_tok: ["Plots","precision-recall","(","PR",")","curves","for","the","detection","results",".","Args",":","classes","(","None",")",":","a","list","of","classes","to","generate","curves","for",".","By","default",",","the","top","3","AP","classes","will","be","plotted","num_points","(","101",")",":","the","number","of","linearly","spaced","recall","values","to","plot","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_pr_curves","`","-","``","matplotlib","''","backend",":",":","meth",":","`","fiftyone.core.plots.matplotlib.plot_pr_curves","`","Returns",":","one","of","the","following",":","-","a",":","class",":","`","fiftyone.core.plots.plotly.PlotlyNotebookPlot","`",",","if","you","are","working","in","a","notebook","context","and","the","plotly","backend","is","used","-","a","plotly","or","matplotlib","figure",",","otherwise"]
code: def plot_pr_curves(
      self, classes=None, num_points=101, backend="plotly", **kwargs
  ):
      """Plots precision-recall (PR) curves for the detection results.
  
      Args:
          classes (None): a list of classes to generate curves for. By
              default, the top 3 AP classes will be plotted
          num_points (101): the number of linearly spaced recall values to
              plot
          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_pr_curves`
              -   "matplotlib" backend: :meth:`fiftyone.core.plots.matplotlib.plot_pr_curves`
  
      Returns:
          one of the following:
  
          -   a :class:`fiftyone.core.plots.plotly.PlotlyNotebookPlot`, if
              you are working in a notebook context and the plotly backend is
              used
          -   a plotly or matplotlib figure, otherwise
      """
      if classes is not None:
          self._validate_classes(classes)
      else:
          classwise_AP = [
              (ap, c) for c, ap in self._classwise_AP.items()
          ]
          classes = [c for ap, c in sorted(classwise_AP)[-3:]]
  
      precisions = []
      recall = None
  
      has_thresholds = self.thresholds is not None
      thresholds = [] if has_thresholds else None
  
      for c in classes:
          p = self.precision.get(c, None)
          r = self.recall.get(c, None)
          if has_thresholds:
              t = self.thresholds.get(c, None)
          else:
              t = None
  
          pre, rec, thr = _interpolate_pr(
              p, r, thresholds=t, num_points=num_points
          )
  
          precisions.append(pre)
  
          if recall is None:
              recall = rec
  
          if has_thresholds:
              thresholds.append(thr)
  
      return fop.plot_pr_curves(
          precisions,
          recall,
          classes,
          thresholds=thresholds,
          backend=backend,
          **kwargs,
      )
  
imports: from collections import defaultdict
  from copy import deepcopy
  import numpy
  import fiftyone.core.plots
  import fiftyone.utils.iou
  from .detection import DetectionEvaluation, DetectionEvaluationConfig, DetectionResults
label_desc: Use image node_id 2 for calling the OpenImagesDetectionResults obj's underlying member method code with example usage: obj.plot_pr_curves(classes, num_points, backend) and returns: fop