def eval_metric_from_prediction(
        self,
        anomalies: Union[TimeSeries, Sequence[TimeSeries]],
        series: Union[TimeSeries, Sequence[TimeSeries]],
        pred_series: Union[TimeSeries, Sequence[TimeSeries]],
        metric: Literal["AUC_ROC", "AUC_PR"] = "AUC_ROC",
    ) -> Union[float, Sequence[float], Sequence[Sequence[float]]]:
        """Computes the anomaly score between `series` and `pred_series`, and returns the score
        of an agnostic threshold metric.

        Parameters
        ----------
        anomalies
            The (sequence of) ground truth binary anomaly series (`1` if it is an anomaly and `0` if not).
        series
            The (sequence of) actual series.
        pred_series
            The (sequence of) predicted series.
        metric
            The name of the metric function to use. Must be one of "AUC_ROC" (Area Under the
            Receiver Operating Characteristic Curve) and "AUC_PR" (Average Precision from scores).
            Default: "AUC_ROC".

        Returns
        -------
        float
            A single metric value for a single univariate `series`.
        Sequence[float]
            A sequence of metric values for:

            - a single multivariate `series`.
            - a sequence of univariate `series`.
        Sequence[Sequence[float]]
            A sequence of sequences of metric values for a sequence of multivariate `series`.
            The outer sequence is over the series, and inner sequence is over the series' components/columns.
        """
        self._check_univariate_scorer(anomalies)
        pred_scores = self.score_from_prediction(series, pred_series)
        return eval_metric_from_scores(
            anomalies=anomalies,
            pred_scores=pred_scores,
            window=self.window,
            metric=metric,
        )
Computes the anomaly score between `series` and `pred_series`, and returns the score
        of an agnostic threshold metric.

        Parameters
        ----------
        anomalies
            The (sequence of) ground truth binary anomaly series (`1` if it is an anomaly and `0` if not).
        series
            The (sequence of) actual series.
        pred_series
            The (sequence of) predicted series.
        metric
            The name of the metric function to use. Must be one of "AUC_ROC" (Area Under the
            Receiver Operating Characteristic Curve) and "AUC_PR" (Average Precision from scores).
            Default: "AUC_ROC".

        Returns
        -------
        float
            A single metric value for a single univariate `series`.
        Sequence[float]
            A sequence of metric values for:

            - a single multivariate `series`.
            - a sequence of univariate `series`.
        Sequence[Sequence[float]]
            A sequence of sequences of metric values for a sequence of multivariate `series`.
            The outer sequence is over the series, and inner sequence is over the series' components/columns.
        
darts/ad/scorers/scorers.py