class_docstr: Base class of scorers that do need training.
docstr: Fits the scorer 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 series. By default, ``diff_fn`` will compute the absolute difference (Default: "abs_diff").
  If `pred_series` and `actual_series` are sequences, ``diff_fn`` will be applied to all pairwise elements
  of the sequences.
  
  The scorer will then be fitted on this (sequence of) series. If a sequence of series is given,
  the scorer will be fitted on the concatenation of the sequence.
  
  The scorer assumes that the (sequence of) actual_series is anomaly-free.
  
  Parameters
  ----------
  actual_series
      The (sequence of) actual series.
  pred_series
      The (sequence of) predicted series.
  
  Returns
  -------
  self
      Fitted Scorer.
docstr_tok: ["Fits","the","scorer","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","series",".","By","default",",","``","diff_fn","``","will","compute","the","absolute","difference","(","Default",":","``","abs_diff","''",")",".","If","`","pred_series","`","and","`","actual_series","`","are","sequences",",","``","diff_fn","``","will","be","applied","to","all","pairwise","elements","of","the","sequences",".","The","scorer","will","then","be","fitted","on","this","(","sequence","of",")","series",".","If","a","sequence","of","series","is","given",",","the","scorer","will","be","fitted","on","the","concatenation","of","the","sequence",".","The","scorer","assumes","that","the","(","sequence","of",")","actual_series","is","anomaly-free",".","Parameters","--","--","--","--","--","actual_series","The","(","sequence","of",")","actual","series",".","pred_series","The","(","sequence","of",")","predicted","series",".","Returns","--","--","--","-","self","Fitted","Scorer","."]
code: def fit_from_prediction(
      self,
      actual_series: Union[TimeSeries, Sequence[TimeSeries]],
      pred_series: Union[TimeSeries, Sequence[TimeSeries]],
  ):
      """Fits the scorer 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 series. By default, ``diff_fn`` will compute the absolute difference (Default: "abs_diff").
      If `pred_series` and `actual_series` are sequences, ``diff_fn`` will be applied to all pairwise elements
      of the sequences.
  
      The scorer will then be fitted on this (sequence of) series. If a sequence of series is given,
      the scorer will be fitted on the concatenation of the sequence.
  
      The scorer assumes that the (sequence of) actual_series is anomaly-free.
  
      Parameters
      ----------
      actual_series
          The (sequence of) actual series.
      pred_series
          The (sequence of) predicted series.
  
      Returns
      -------
      self
          Fitted Scorer.
      """
      list_actual_series, list_pred_series = _to_list(
          actual_series
      ), _to_list(pred_series)
      _assert_same_length(list_actual_series, list_pred_series)
  
      list_fit_series = []
      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")
          list_fit_series.append(self._diff_series(s1, s2))
  
      self.fit(list_fit_series)
      self._fit_called = True
  
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 8 for calling the FittableAnomalyScorer obj's underlying member method code with example usage: obj.fit_from_prediction(actual_series, pred_series) without return types