docstr: Compute the accuracy of the anomaly scores computed by the model.
  
  Predicts the `series` with the filtering model, and applies the
  scorer(s) on the filtered time series and the given target time series. Returns the
  score(s) of an agnostic threshold metric, based on the anomaly score given by the scorer(s).
  
  Parameters
  ----------
  actual_anomalies
      The (sequence of) ground truth of the anomalies (1 if it is an anomaly and 0 if not)
  series
      The (sequence of) series to predict anomalies on.
  metric
      Optionally, Scoring function to use. Must be one of "AUC_ROC" and "AUC_PR".
      Default: "AUC_ROC"
  filter_kwargs
      parameters of the Darts `.filter()` filtering model
  
  Returns
  -------
  Union[Dict[str, float], Dict[str, Sequence[float]], Sequence[Dict[str, float]],
  Sequence[Dict[str, Sequence[float]]]]
      Score for the time series.
      A (sequence of) dictionary with the keys being the name of the scorers, and the values being the
      metric results on the (sequence of) `series`. If the scorer treats every dimension independently
      (by nature of the scorer or if its component_wise is set to True), the values of the dictionary
      will be a Sequence containing the score for each dimension.
docstr_tok: ["Compute","the","accuracy","of","the","anomaly","scores","computed","by","the","model",".","Predicts","the","`","series","`","with","the","filtering","model",",","and","applies","the","scorer","(","s",")","on","the","filtered","time","series","and","the","given","target","time","series",".","Returns","the","score","(","s",")","of","an","agnostic","threshold","metric",",","based","on","the","anomaly","score","given","by","the","scorer","(","s",")",".","Parameters","--","--","--","--","--","actual_anomalies","The","(","sequence","of",")","ground","truth","of","the","anomalies","(","1","if","it","is","an","anomaly","and","0","if","not",")","series","The","(","sequence","of",")","series","to","predict","anomalies","on",".","metric","Optionally",",","Scoring","function","to","use",".","Must","be","one","of","``","AUC_ROC","''","and","``","AUC_PR","''",".","Default",":","``","AUC_ROC","''","filter_kwargs","parameters","of","the","Darts","`",".filter","(",")","`","filtering","model","Returns","--","--","--","-","Union","[","Dict","[","str",",","float","]",",","Dict","[","str",",","Sequence","[","float","]","]",",","Sequence","[","Dict","[","str",",","float","]","]",",","Sequence","[","Dict","[","str",",","Sequence","[","float","]","]","]","]","Score","for","the","time","series",".","A","(","sequence","of",")","dictionary","with","the","keys","being","the","name","of","the","scorers",",","and","the","values","being","the","metric","results","on","the","(","sequence","of",")","`","series","`",".","If","the","scorer","treats","every","dimension","independently","(","by","nature","of","the","scorer","or","if","its","component_wise","is","set","to","True",")",",","the","values","of","the","dictionary","will","be","a","Sequence","containing","the","score","for","each","dimension","."]
code: def eval_accuracy(
      self,
      actual_anomalies: Union[TimeSeries, Sequence[TimeSeries]],
      series: Union[TimeSeries, Sequence[TimeSeries]],
      metric: str = "AUC_ROC",
      **filter_kwargs,
  ) -> Union[
      Dict[str, float],
      Dict[str, Sequence[float]],
      Sequence[Dict[str, float]],
      Sequence[Dict[str, Sequence[float]]],
  ]:
      """Compute the accuracy of the anomaly scores computed by the model.
  
      Predicts the `series` with the filtering model, and applies the
      scorer(s) on the filtered time series and the given target time series. Returns the
      score(s) of an agnostic threshold metric, based on the anomaly score given by the scorer(s).
  
      Parameters
      ----------
      actual_anomalies
          The (sequence of) ground truth of the anomalies (1 if it is an anomaly and 0 if not)
      series
          The (sequence of) series to predict anomalies on.
      metric
          Optionally, Scoring function to use. Must be one of "AUC_ROC" and "AUC_PR".
          Default: "AUC_ROC"
      filter_kwargs
          parameters of the Darts `.filter()` filtering model
  
      Returns
      -------
      Union[Dict[str, float], Dict[str, Sequence[float]], Sequence[Dict[str, float]],
      Sequence[Dict[str, Sequence[float]]]]
          Score for the time series.
          A (sequence of) dictionary with the keys being the name of the scorers, and the values being the
          metric results on the (sequence of) `series`. If the scorer treats every dimension independently
          (by nature of the scorer or if its component_wise is set to True), the values of the dictionary
          will be a Sequence containing the score for each dimension.
      """
      list_series, list_actual_anomalies = _to_list(series), _to_list(
          actual_anomalies
      )
  
      raise_if_not(
          all([isinstance(s, TimeSeries) for s in list_series]),
          "all input `series` must be of type Timeseries.",
      )
  
      raise_if_not(
          all(
              [isinstance(s, TimeSeries) for s in list_actual_anomalies]
          ),
          "all input `actual_anomalies` must be of type Timeseries.",
      )
  
      _assert_same_length(list_series, list_actual_anomalies)
      self._check_univariate(list_actual_anomalies)
  
      list_anomaly_scores = self.score(
          series=list_series, **filter_kwargs
      )
  
      acc_anomaly_scores = self._eval_accuracy_from_scores(
          list_actual_anomalies=list_actual_anomalies,
          list_anomaly_scores=list_anomaly_scores,
          metric=metric,
      )
  
      if len(acc_anomaly_scores) == 1 and not isinstance(
          series, Sequence
      ):
          return acc_anomaly_scores[0]
      else:
          return acc_anomaly_scores
  
file_path: darts/darts/ad/anomaly_model/filtering_am.py
imports: from typing import Dict, Sequence, Union
  from darts.ad.anomaly_model.anomaly_model import AnomalyModel
  from darts.ad.scorers.scorers import AnomalyScorer
  from darts.ad.utils import _assert_same_length, _to_list
  from darts.logging import get_logger, raise_if_not
  from darts.models.filtering.filtering_model import FilteringModel
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 5 for calling the FilteringAnomalyModel obj's underlying member method code with example usage: obj.eval_accuracy(actual_anomalies, series, metric) and returns: acc_anomaly_scores, acc_anomaly_scores