docstr: Compute the anomaly score(s) for the given series.
  
  Predicts the given target time series with the filtering model, and applies the scorer(s)
  to compare the predicted (filtered) series and the provided series.
  
  Outputs the anomaly score(s) of the provided time series.
  
  Parameters
  ----------
  series
      The (sequence of) series to score.
  return_model_prediction
      Boolean value indicating if the prediction of the model should be returned along the anomaly score
      Default: False
  filter_kwargs
      parameters of the Darts `.filter()` filtering model
  
  Returns
  -------
  Union[TimeSeries, Sequence[TimeSeries], Sequence[Sequence[TimeSeries]]]
      Anomaly scores series generated by the anomaly model scorers
  
          - ``TimeSeries`` if `series` is a series, and the anomaly model contains one scorer.
          - ``Sequence[TimeSeries]``
  
              * If `series` is a series, and the anomaly model contains multiple scorers,
              returns one series per scorer.
              * If `series` is a sequence, and the anomaly model contains one scorer,
              returns one series per series in the sequence.
          - ``Sequence[Sequence[TimeSeries]]`` if `series` is a sequence, and the anomaly
          model contains multiple scorers.
          The outer sequence is over the series, and inner sequence is over the scorers.
docstr_tok: ["Compute","the","anomaly","score","(","s",")","for","the","given","series",".","Predicts","the","given","target","time","series","with","the","filtering","model",",","and","applies","the","scorer","(","s",")","to","compare","the","predicted","(","filtered",")","series","and","the","provided","series",".","Outputs","the","anomaly","score","(","s",")","of","the","provided","time","series",".","Parameters","--","--","--","--","--","series","The","(","sequence","of",")","series","to","score",".","return_model_prediction","Boolean","value","indicating","if","the","prediction","of","the","model","should","be","returned","along","the","anomaly","score","Default",":","False","filter_kwargs","parameters","of","the","Darts","`",".filter","(",")","`","filtering","model","Returns","--","--","--","-","Union","[","TimeSeries",",","Sequence","[","TimeSeries","]",",","Sequence","[","Sequence","[","TimeSeries","]","]","]","Anomaly","scores","series","generated","by","the","anomaly","model","scorers","-","``","TimeSeries","``","if","`","series","`","is","a","series",",","and","the","anomaly","model","contains","one","scorer",".","-","``","Sequence","[","TimeSeries","]","``","*","If","`","series","`","is","a","series",",","and","the","anomaly","model","contains","multiple","scorers",",","returns","one","series","per","scorer",".","*","If","`","series","`","is","a","sequence",",","and","the","anomaly","model","contains","one","scorer",",","returns","one","series","per","series","in","the","sequence",".","-","``","Sequence","[","Sequence","[","TimeSeries","]","]","``","if","`","series","`","is","a","sequence",",","and","the","anomaly","model","contains","multiple","scorers",".","The","outer","sequence","is","over","the","series",",","and","inner","sequence","is","over","the","scorers","."]
code: def score(
      self,
      series: Union[TimeSeries, Sequence[TimeSeries]],
      return_model_prediction: bool = False,
      **filter_kwargs,
  ):
      """Compute the anomaly score(s) for the given series.
  
      Predicts the given target time series with the filtering model, and applies the scorer(s)
      to compare the predicted (filtered) series and the provided series.
  
      Outputs the anomaly score(s) of the provided time series.
  
      Parameters
      ----------
      series
          The (sequence of) series to score.
      return_model_prediction
          Boolean value indicating if the prediction of the model should be returned along the anomaly score
          Default: False
      filter_kwargs
          parameters of the Darts `.filter()` filtering model
  
      Returns
      -------
      Union[TimeSeries, Sequence[TimeSeries], Sequence[Sequence[TimeSeries]]]
          Anomaly scores series generated by the anomaly model scorers
  
              - ``TimeSeries`` if `series` is a series, and the anomaly model contains one scorer.
              - ``Sequence[TimeSeries]``
  
                  * If `series` is a series, and the anomaly model contains multiple scorers,
                  returns one series per scorer.
                  * If `series` is a sequence, and the anomaly model contains one scorer,
                  returns one series per series in the sequence.
              - ``Sequence[Sequence[TimeSeries]]`` if `series` is a sequence, and the anomaly
              model contains multiple scorers.
              The outer sequence is over the series, and inner sequence is over the scorers.
      """
      raise_if_not(
          type(return_model_prediction) is bool,
          f"`return_model_prediction` must be Boolean, found type: {type(return_model_prediction)}.",
      )
  
      list_series = _to_list(series)
  
      # TODO: vectorize this call later on if we have any filtering models allowing this
      list_pred = [
          self.filter.filter(s, **filter_kwargs) for s in list_series
      ]
  
      scores = list(
          zip(
              *[
                  sc.score_from_prediction(list_series, list_pred)
                  for sc in self.scorers
              ]
          )
      )
  
      if len(scores) == 1 and not isinstance(series, Sequence):
          # there's only one series
          scores = scores[0]
          if len(scores) == 1:
              # there's only one scorer
              scores = scores[0]
  
      if len(list_pred) == 1:
          list_pred = list_pred[0]
  
      if return_model_prediction:
          return scores, list_pred
      else:
          return 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 4 for calling the FilteringAnomalyModel obj's underlying member method code with example usage: obj.score(series, return_model_prediction) and returns: scores,  list_pred, scores