class_docstr: Base class of scorers that do need training.
docstr: Computes the anomaly score on the two (sequence of) series.
  
  The function ``diff_fn`` passed as a parameter to the scorer, will transform `pred_series` and `actual_series`
  into one "difference" series. By default, ``diff_fn`` will compute the absolute difference
  (Default: "abs_diff").
  If actual_series and pred_series are sequences, ``diff_fn`` will be applied to all pairwise elements
  of the sequences.
  
  The scorer will then transform this series into an anomaly score. If a sequence of series is given,
  the scorer will score each series independently and return an anomaly score for each series in the sequence.
  
  Parameters
  ----------
  actual_series
      The (sequence of) actual series.
  pred_series
      The (sequence of) predicted series.
  
  Returns
  -------
  Union[TimeSeries, Sequence[TimeSeries]]
      (Sequence of) anomaly score time series
docstr_tok: ["Computes","the","anomaly","score","on","the","two","(","sequence","of",")","series",".","The","function","``","diff_fn","``","passed","as","a","parameter","to","the","scorer",",","will","transform","`","pred_series","`","and","`","actual_series","`","into","one","``","difference","''","series",".","By","default",",","``","diff_fn","``","will","compute","the","absolute","difference","(","Default",":","``","abs_diff","''",")",".","If","actual_series","and","pred_series","are","sequences",",","``","diff_fn","``","will","be","applied","to","all","pairwise","elements","of","the","sequences",".","The","scorer","will","then","transform","this","series","into","an","anomaly","score",".","If","a","sequence","of","series","is","given",",","the","scorer","will","score","each","series","independently","and","return","an","anomaly","score","for","each","series","in","the","sequence",".","Parameters","--","--","--","--","--","actual_series","The","(","sequence","of",")","actual","series",".","pred_series","The","(","sequence","of",")","predicted","series",".","Returns","--","--","--","-","Union","[","TimeSeries",",","Sequence","[","TimeSeries","]","]","(","Sequence","of",")","anomaly","score","time","series"]
code: def score_from_prediction(
      self,
      actual_series: Union[TimeSeries, Sequence[TimeSeries]],
      pred_series: Union[TimeSeries, Sequence[TimeSeries]],
  ) -> Union[TimeSeries, Sequence[TimeSeries]]:
      """Computes the anomaly score on the two (sequence of) series.
  
      The function ``diff_fn`` passed as a parameter to the scorer, will transform `pred_series` and `actual_series`
      into one "difference" series. By default, ``diff_fn`` will compute the absolute difference
      (Default: "abs_diff").
      If actual_series and pred_series are sequences, ``diff_fn`` will be applied to all pairwise elements
      of the sequences.
  
      The scorer will then transform this series into an anomaly score. If a sequence of series is given,
      the scorer will score each series independently and return an anomaly score for each series in the sequence.
  
      Parameters
      ----------
      actual_series
          The (sequence of) actual series.
      pred_series
          The (sequence of) predicted series.
  
      Returns
      -------
      Union[TimeSeries, Sequence[TimeSeries]]
          (Sequence of) anomaly score time series
      """
  
      self.check_if_fit_called()
  
      list_actual_series, list_pred_series = _to_list(
          actual_series
      ), _to_list(pred_series)
      _assert_same_length(list_actual_series, list_pred_series)
  
      anomaly_scores = []
      for s1, s2 in zip(list_actual_series, list_pred_series):
          _sanity_check_two_series(s1, s2)
          s1 = self._assert_deterministic(s1, "actual_series")
          s2 = self._assert_deterministic(s2, "pred_series")
          diff = self._diff_series(s1, s2)
          self._check_window_size(diff)
          anomaly_scores.append(self.score(diff))
  
      if (
          len(anomaly_scores) == 1
          and not isinstance(pred_series, Sequence)
          and not isinstance(actual_series, Sequence)
      ):
          return anomaly_scores[0]
      else:
          return anomaly_scores
  
imports: from abc import ABC, abstractmethod
  from typing import Any, Sequence, Union
  import numpy
  from darts import TimeSeries
  from darts.ad.utils import _assert_same_length, _assert_timeseries, _intersect, _sanity_check_two_series, _to_list, eval_accuracy_from_scores, show_anomalies_from_scores
  from darts.logging import get_logger, raise_if_not
label_desc: Use image node_id 6 for calling the FittableAnomalyScorer obj's underlying member method code with example usage: obj.score_from_prediction(actual_series, pred_series) and returns: anomaly_scores, anomaly_scores