class_docstr: Abstract class to calculate average precision and recall for various vision tasks.
  
  Parameters
  ----------
  max_dets: Union[List[int], Tuple[int]], default: [1, 10, 100]
      Maximum number of detections per class.
  area_range: tuple, default: (32**2, 96**2)
      Slices for small/medium/large buckets.
  return_option: str, default: 'ap'
      ap: ap only, ar: ar only, None: all (not ignite compliant).
  average: str, default: none
      The method for averaging over the classes. If none, returns the result per class.
  iou_range: Tuple[float, float, float], default: (0.5, 0.95, 10)
      The closed range of the iou values (min, max (including), number of points)
class_docstr_tok: ["Abstract","class","to","calculate","average","precision","and","recall","for","various","vision","tasks",".","Parameters","--","--","--","--","--","max_dets",":","Union","[","List","[","int","]",",","Tuple","[","int","]","]",",","default",":","[","1",",","10",",","100","]","Maximum","number","of","detections","per","class",".","area_range",":","tuple",",","default",":","(","32","*","*","2",",","96","*","*","2",")","Slices","for","small\/medium\/large","buckets",".","return_option",":","str",",","default",":","'ap'","ap",":","ap","only",",","ar",":","ar","only",",","None",":","all","(","not","ignite","compliant",")",".","average",":","str",",","default",":","none","The","method","for","averaging","over","the","classes",".","If","none",",","returns","the","result","per","class",".","iou_range",":","Tuple","[","float",",","float",",","float","]",",","default",":","(","0.5",",","0.95",",","10",")","The","closed","range","of","the","iou","values","(","min",",","max","(","including",")",",","number","of","points",")"]
docstr: Get the mean value of the classes scores and the result values.
  
  Parameters
  ----------
  res: np.array
      either precision or recall when using the '2' return option
  iou : float, default: None
      filter by iou threshold
  area : str, default: None
      filter by are range name ['small', 'medium', 'large', 'all']
  max_dets : int, default: None
      filter by max detections
  get_mean_val : bool, default: True
      get mean value if True, if False get per class
  zeroed_negative : bool, default: True
      if getting the class results list set negative (-1) values to 0
  class_weights : np.array, default None
      The class weights for weighted macro averaging. If None, gives equal weights to all the classes.
  
  Returns
  -------
  Union[List[float], float]
     The mean value of the classes scores or the scores list.
docstr_tok: ["Get","the","mean","value","of","the","classes","scores","and","the","result","values",".","Parameters","--","--","--","--","--","res",":","np.array","either","precision","or","recall","when","using","the","'","2","'","return","option","iou",":","float",",","default",":","None","filter","by","iou","threshold","area",":","str",",","default",":","None","filter","by","are","range","name","[","'small","'",",","'medium","'",",","'large","'",",","'all","'","]","max_dets",":","int",",","default",":","None","filter","by","max","detections","get_mean_val",":","bool",",","default",":","True","get","mean","value","if","True",",","if","False","get","per","class","zeroed_negative",":","bool",",","default",":","True","if","getting","the","class","results","list","set","negative","(","-1",")","values","to","0","class_weights",":","np.array",",","default","None","The","class","weights","for","weighted","macro","averaging",".","If","None",",","gives","equal","weights","to","all","the","classes",".","Returns","--","--","--","-","Union","[","List","[","float","]",",","float","]","The","mean","value","of","the","classes","scores","or","the","scores","list","."]
code: def get_classes_scores_at(
      self,
      res: np.ndarray,
      iou: float = None,
      area: str = None,
      max_dets: int = None,
      get_mean_val: bool = True,
      zeroed_negative: bool = True,
      class_weights: np.ndarray = None,
  ):
      """Get the mean value of the classes scores and the result values.
  
      Parameters
      ----------
      res: np.array
          either precision or recall when using the '2' return option
      iou : float, default: None
          filter by iou threshold
      area : str, default: None
          filter by are range name ['small', 'medium', 'large', 'all']
      max_dets : int, default: None
          filter by max detections
      get_mean_val : bool, default: True
          get mean value if True, if False get per class
      zeroed_negative : bool, default: True
          if getting the class results list set negative (-1) values to 0
      class_weights : np.array, default None
          The class weights for weighted macro averaging. If None, gives equal weights to all the classes.
  
      Returns
      -------
      Union[List[float], float]
         The mean value of the classes scores or the scores list.
      """
      res = self.filter_res(res, iou, area, max_dets)
  
      with warnings.catch_warnings():
          warnings.simplefilter(
              action="ignore", category=RuntimeWarning
          )
          res = np.nanmean(res[:, :, :], axis=0)
          if get_mean_val:
              filtered_res = res[~np.isnan(res) & (res > -1)]
              num_classes = filtered_res.shape[-1]
              if class_weights is None:
                  class_weights = np.empty(num_classes)
                  class_weights.fill(1 / num_classes)
              if len(class_weights) != num_classes:
                  raise DeepchecksValueError(
                      "The class weights shape must match the number of classes"
                  )
              weighted_result = np.dot(filtered_res, class_weights)
              return weighted_result
          if zeroed_negative:
              res = res.clip(min=0)
          return res[0][0]
  
imports: import warnings
  from collections import defaultdict
  from typing import List, Optional, Tuple, Union
  import numpy
  from ignite.metrics import Metric
  from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.vision.metrics_utils.metric_mixin import MetricMixin, ObjectDetectionMetricMixin
label_desc: Use image node_id 11 for calling the AveragePrecisionRecall obj's underlying member method code with example usage: obj.get_classes_scores_at(res, iou, area, max_dets, get_mean_val, zeroed_negative, class_weights) and returns: res, weighted_result