class_docstr: Base class for all detectors
class_docstr_tok: ["Base","class","for","all","detectors"]
docstr: Score the results against true anomalies.
  
  Parameters
  ----------
  actual_anomalies
      The ground truth of the anomalies (1 if it is an anomaly and 0 if not).
  anomaly_score
      Series indicating how anomoulous each window of size w is.
  window
      Integer value indicating the number of past samples each point represents
      in the anomaly_score.
  metric
      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
docstr_tok: ["Score","the","results","against","true","anomalies",".","Parameters","--","--","--","--","--","actual_anomalies","The","ground","truth","of","the","anomalies","(","1","if","it","is","an","anomaly","and","0","if","not",")",".","anomaly_score","Series","indicating","how","anomoulous","each","window","of","size","w","is",".","window","Integer","value","indicating","the","number","of","past","samples","each","point","represents","in","the","anomaly_score",".","metric","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"]
code: def eval_accuracy(
      self,
      actual_anomalies: Union[TimeSeries, Sequence[TimeSeries]],
      anomaly_score: Union[TimeSeries, Sequence[TimeSeries]],
      window: int = 1,
      metric: str = "recall",
  ) -> Union[float, Sequence[float], Sequence[Sequence[float]]]:
      """Score the results against true anomalies.
  
      Parameters
      ----------
      actual_anomalies
          The ground truth of the anomalies (1 if it is an anomaly and 0 if not).
      anomaly_score
          Series indicating how anomoulous each window of size w is.
      window
          Integer value indicating the number of past samples each point represents
          in the anomaly_score.
      metric
          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
      """
  
      if isinstance(anomaly_score, Sequence):
          raise_if_not(
              all([isinstance(s, TimeSeries) for s in anomaly_score]),
              "all series in `anomaly_score` must be of type TimeSeries.",
          )
  
          raise_if_not(
              all([s.is_deterministic for s in anomaly_score]),
              "all series in `anomaly_score` must be deterministic (number of samples equal to 1).",
          )
      else:
          raise_if_not(
              isinstance(anomaly_score, TimeSeries),
              f"Input `anomaly_score` must be of type TimeSeries, found {type(anomaly_score)}.",
          )
  
          raise_if_not(
              anomaly_score.is_deterministic,
              "Input `anomaly_score` must be deterministic (number of samples equal to 1).",
          )
  
      return eval_accuracy_from_binary_prediction(
          actual_anomalies, self.detect(anomaly_score), window, metric
      )
  
file_path: darts/darts/ad/detectors/detectors.py
imports: from abc import ABC, abstractmethod
  from typing import Any, Sequence, Union
  from darts import TimeSeries
  from darts.ad.utils import eval_accuracy_from_binary_prediction
  from darts.logging import raise_if_not
label_desc: Use image node_id 4 for calling the Detector obj's underlying member method code with example usage: obj.eval_accuracy(actual_anomalies, anomaly_score, window, metric) and returns: eval_accuracy_from_binary_prediction