docstr: Train the detector with given time series.
  
  Parameters
  ----------
  ts: pandas.Series or pandas.DataFrame
      Time series to be used to train the detector.
      If a DataFrame with k columns, k univariate detectors will be
      trained independently.
docstr_tok: ["Train","the","detector","with","given","time","series",".","Parameters","--","--","--","--","--","ts",":","pandas.Series","or","pandas.DataFrame","Time","series","to","be","used","to","train","the","detector",".","If","a","DataFrame","with","k","columns",",","k","univariate","detectors","will","be","trained","independently","."]
code: def fit(self, ts: Union[pd.Series, pd.DataFrame]) -> None:
      """Train the detector with given time series.
  
      Parameters
      ----------
      ts: pandas.Series or pandas.DataFrame
          Time series to be used to train the detector.
          If a DataFrame with k columns, k univariate detectors will be
          trained independently.
  
      """
      self._fit(ts)
  
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 1 for calling the _TrainableUnivariateDetector obj's underlying member method code with example usage: obj.fit(ts) without return types