docstr: Train the detector and detect anomalies from the time series used
  for training.
  
  Parameters
  ----------
  df: pandas.DataFrame
      Time series to be used for training and be detected for anomalies.
  
  return_list: bool, optional
      Whether to return a list of anomalous events, or a binary series
      indicating normal/anomalous. Default: False.
  
  Returns
  -------
  pandas.Series or list
      Detected anomalies.
  
      - If return_list=False, return a binary series;
      - If return_list=True, return a list of events where an event is a
        pandas Timestamp if it is instantaneous or a 2-tuple of pandas
        Timestamps if it is a closed time interval.
docstr_tok: ["Train","the","detector","and","detect","anomalies","from","the","time","series","used","for","training",".","Parameters","--","--","--","--","--","df",":","pandas.DataFrame","Time","series","to","be","used","for","training","and","be","detected","for","anomalies",".","return_list",":","bool",",","optional","Whether","to","return","a","list","of","anomalous","events",",","or","a","binary","series","indicating","normal\/anomalous",".","Default",":","False",".","Returns","--","--","--","-","pandas.Series","or","list","Detected","anomalies",".","-","If","return_list=False",",","return","a","binary","series",";","-","If","return_list=True",",","return","a","list","of","events","where","an","event","is","a","pandas","Timestamp","if","it","is","instantaneous","or","a","2-tuple","of","pandas","Timestamps","if","it","is","a","closed","time","interval","."]
code: def fit_predict(
      self, df: pd.DataFrame, return_list: bool = False
  ) -> Union[
      pd.Series,
      List[Union[Tuple[pd.Timestamp, pd.Timestamp], pd.Timestamp]],
  ]:
      """Train the detector and detect anomalies from the time series used
      for training.
  
      Parameters
      ----------
      df: pandas.DataFrame
          Time series to be used for training and be detected for anomalies.
  
      return_list: bool, optional
          Whether to return a list of anomalous events, or a binary series
          indicating normal/anomalous. Default: False.
  
      Returns
      -------
      pandas.Series or list
          Detected anomalies.
  
          - If return_list=False, return a binary series;
          - If return_list=True, return a list of events where an event is a
            pandas Timestamp if it is instantaneous or a 2-tuple of pandas
            Timestamps if it is a closed time interval.
  
      """
      self.fit(df)
      return self.detect(df, return_list=return_list)
  
imports: from typing import Any, Callable, Dict, List, Tuple, Union
  import pandas
  from ._base import _NonTrainableUnivariateModel, _TrainableMultivariateModel, _TrainableUnivariateModel
  from .data import to_events
  from .metrics import f1_score, iou, precision, recall
label_desc: Use image node_id 3 for calling the _TrainableMultivariateDetector obj's underlying member method code with example usage: obj.fit_predict(df, return_list) and returns: self