def score_from_prediction(
        self,
        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 `series`
        into one "difference" series. By default, `diff_fn` will compute the absolute difference
        (Default: :func:`~darts.metrics.metrics.ae`).
        If 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
        ----------
        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_fit_called()

        called_with_single_series = isinstance(series, TimeSeries)
        series = _check_input(series, "series")
        pred_series = _check_input(pred_series, "pred_series")

        diff = self._diff_series(series, pred_series)
        pred_scores = self.score(diff)
        return pred_scores[0] if called_with_single_series else pred_scores
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 `series`
        into one "difference" series. By default, `diff_fn` will compute the absolute difference
        (Default: :func:`~darts.metrics.metrics.ae`).
        If 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
        ----------
        series
            The (sequence of) actual series.
        pred_series
            The (sequence of) predicted series.

        Returns
        -------
        Union[TimeSeries, Sequence[TimeSeries]]
            (Sequence of) anomaly score time series
        
darts/ad/scorers/scorers.py