def eval_metric(
        self,
        anomalies: Union[TimeSeries, Sequence[TimeSeries]],
        pred_scores: Union[TimeSeries, Sequence[TimeSeries]],
        window: int = 1,
        metric: Literal["recall", "precision", "f1", "accuracy"] = "recall",
    ) -> Union[float, Sequence[float], Sequence[Sequence[float]]]:
        """Score the results against true anomalies.

        Parameters
        ----------
        anomalies
            The (sequence of) ground truth binary anomaly series (`1` if it is an anomaly and `0` if not).
        pred_scores
            The (sequence of) of estimated anomaly score series indicating how anomalous each window of size w is.
        window
            Integer value indicating the number of past samples each point represents in the `pred_scores`.
        metric
            The name of the metric function to use. Must be one of "recall", "precision", "f1", and "accuracy".
            Default: "recall".

        Returns
        -------
        Union[float, Sequence[float], Sequence[Sequence[float]]]
            Metric results for each anomaly score
        """
        return eval_metric_from_binary_prediction(
            anomalies=anomalies,
            pred_anomalies=self.detect(pred_scores),
            window=window,
            metric=metric,
        )
Score the results against true anomalies.

        Parameters
        ----------
        anomalies
            The (sequence of) ground truth binary anomaly series (`1` if it is an anomaly and `0` if not).
        pred_scores
            The (sequence of) of estimated anomaly score series indicating how anomalous each window of size w is.
        window
            Integer value indicating the number of past samples each point represents in the `pred_scores`.
        metric
            The name of the metric function to use. Must be one of "recall", "precision", "f1", and "accuracy".
            Default: "recall".

        Returns
        -------
        Union[float, Sequence[float], Sequence[Sequence[float]]]
            Metric results for each anomaly score
        
darts/ad/detectors/detectors.py