class_docstr: Base class of Aggregators that do need training.
class_docstr_tok: ["Base","class","of","Aggregators","that","do","need","training","."]
docstr: Fit the aggregators on the (sequence of) multivariate binary series.
  
  If a list of series is given, they must have the same number of components.
  
  Parameters
  ----------
  actual_anomalies
      The (sequence of) ground truth of the anomalies (1 if it is an anomaly and 0 if not)
  series
      The (sequence of) multivariate binary series
docstr_tok: ["Fit","the","aggregators","on","the","(","sequence","of",")","multivariate","binary","series",".","If","a","list","of","series","is","given",",","they","must","have","the","same","number","of","components",".","Parameters","--","--","--","--","--","actual_anomalies","The","(","sequence","of",")","ground","truth","of","the","anomalies","(","1","if","it","is","an","anomaly","and","0","if","not",")","series","The","(","sequence","of",")","multivariate","binary","series"]
code: def fit(
      self,
      actual_anomalies: Union[TimeSeries, Sequence[TimeSeries]],
      series: Union[TimeSeries, Sequence[TimeSeries]],
  ):
      """Fit the aggregators on the (sequence of) multivariate binary series.
  
      If a list of series is given, they must have the same number of components.
  
      Parameters
      ----------
      actual_anomalies
          The (sequence of) ground truth of the anomalies (1 if it is an anomaly and 0 if not)
      series
          The (sequence of) multivariate binary series
      """
      list_series = self._check_input(series)
      self.width_trained_on = list_series[0].width
  
      raise_if_not(
          all([s.width == self.width_trained_on for s in list_series]),
          "all series in `list_series` must have the same number of components.",
      )
  
      list_actual_anomalies = _to_list(actual_anomalies)
  
      raise_if_not(
          all(
              [isinstance(s, TimeSeries) for s in list_actual_anomalies]
          ),
          "all series in `actual_anomalies` must be of type TimeSeries.",
      )
  
      raise_if_not(
          all([s.is_deterministic for s in list_actual_anomalies]),
          "all series in `actual_anomalies` must be deterministic (width=1).",
      )
  
      raise_if_not(
          all([s.width == 1 for s in list_actual_anomalies]),
          "all series in `actual_anomalies` must be univariate (width=1).",
      )
  
      raise_if_not(
          len(list_actual_anomalies) == len(list_series),
          "`actual_anomalies` and `series` must contain the same number of series.",
      )
  
      same_intersection = list(
          zip(
              *[
                  [
                      anomalies.slice_intersect(series),
                      series.slice_intersect(series),
                  ]
                  for (anomalies, series) in zip(
                      list_actual_anomalies, list_series
                  )
              ]
          )
      )
      list_actual_anomalies = list(same_intersection[0])
      list_series = list(same_intersection[1])
  
      ret = self._fit_core(list_actual_anomalies, list_series)
      self._fit_called = True
      return ret
  
imports: from abc import ABC, abstractmethod
  from typing import Any, Sequence, Union
  import numpy
  from darts import TimeSeries
  from darts.ad.utils import _to_list, eval_accuracy_from_binary_prediction
  from darts.logging import raise_if_not
label_desc: Use image node_id 3 for calling the FittableAggregator obj's underlying member method code with example usage: obj.fit(actual_anomalies, series) and returns: ret