class_docstr: A Pipeline object chains transformers and a detector sequentially.
  
  Parameters
  ----------
  steps: list of 2-tuples (str, object)
      Components of this pipeline. Each 2-tuple represents a step in the
      pipeline (step name, model object).
  
  Examples
  --------
  >>> steps = [('moving average', RollingAggregate(agg='mean', window=10)),
               ('filter quantile 0.99', QuantileAD(high=0.99))]
  >>> myPipeline = Pipeline(steps)
docstr: Detect anomalies and score the results against true anomalies.
  
  Parameters
  ----------
  ts: pandas Series or DataFrame
      Time series to detect anomalies from.
  
  anomaly_true: pandas Series or list
      True anomalies.
  
      - If pandas Series, it is treated as a series of binary labels.
      - If list, 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.
  
  scoring: str, optional
      Scoring function to use. Must be one of "recall", "precision",
      "f1", and "iou". See module `metrics` for more information.
      Default: "recall"
  
  **kwargs
      Optional parameters for scoring function. See module `metrics` for
      more information.
  
  Returns
  -------
  float
      Score of detection result.
docstr_tok: ["Detect","anomalies","and","score","the","results","against","true","anomalies",".","Parameters","--","--","--","--","--","ts",":","pandas","Series","or","DataFrame","Time","series","to","detect","anomalies","from",".","anomaly_true",":","pandas","Series","or","list","True","anomalies",".","-","If","pandas","Series",",","it","is","treated","as","a","series","of","binary","labels",".","-","If","list",",","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",".","scoring",":","str",",","optional","Scoring","function","to","use",".","Must","be","one","of","``","recall","''",",","``","precision","''",",","``","f1","''",",","and","``","iou","''",".","See","module","`","metrics","`","for","more","information",".","Default",":","``","recall","''","*","*","kwargs","Optional","parameters","for","scoring","function",".","See","module","`","metrics","`","for","more","information",".","Returns","--","--","--","-","float","Score","of","detection","result","."]
code: def score(
      self,
      ts: Union[pd.Series, pd.DataFrame],
      anomaly_true: Union[
          pd.Series,
          pd.DataFrame,
          List[Union[Tuple[pd.Timestamp, pd.Timestamp], pd.Timestamp]],
          Dict[
              str,
              List[
                  Union[Tuple[pd.Timestamp, pd.Timestamp], pd.Timestamp]
              ],
          ],
      ],
      scoring: str = "recall",
      **kwargs: Any,
  ) -> Union[float, Dict[str, float]]:
      """Detect anomalies and score the results against true anomalies.
  
      Parameters
      ----------
      ts: pandas Series or DataFrame
          Time series to detect anomalies from.
  
      anomaly_true: pandas Series or list
          True anomalies.
  
          - If pandas Series, it is treated as a series of binary labels.
          - If list, 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.
  
      scoring: str, optional
          Scoring function to use. Must be one of "recall", "precision",
          "f1", and "iou". See module `metrics` for more information.
          Default: "recall"
  
      **kwargs
          Optional parameters for scoring function. See module `metrics` for
          more information.
  
      Returns
      -------
      float
          Score of detection result.
  
      """
      if scoring == "recall":
          scoring_func = recall  # type: Callable
      elif scoring == "precision":
          scoring_func = precision
      elif scoring == "f1":
          scoring_func = f1_score
      elif scoring == "iou":
          scoring_func = iou
      else:
          raise ValueError(
              "Argument `scoring` must be one of 'recall', 'precision', "
              "'f1' and 'iou'."
          )
      if isinstance(anomaly_true, pd.Series):
          return scoring_func(
              y_true=anomaly_true,
              y_pred=self.detect(ts, return_list=False),
              **kwargs,
          )
      else:
          return scoring_func(
              y_true=anomaly_true,
              y_pred=self.detect(ts, return_list=True),
              **kwargs,
          )
  
imports: from collections import OrderedDict
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import matplotlib.pyplot
  import pandas
  from matplotlib.collections import PatchCollection
  from matplotlib.lines import Line2D
  from matplotlib.patches import Circle
  from tabulate import tabulate
  from .._aggregator_base import _Aggregator
  from .._base import _Model, _TrainableModel
  from .._detector_base import _NonTrainableUnivariateDetector, _TrainableMultivariateDetector, _TrainableUnivariateDetector
  from .._transformer_base import _NonTrainableMultivariateTransformer, _NonTrainableUnivariateTransformer, _TrainableMultivariateTransformer, _TrainableUnivariateTransformer
  from ..metrics import f1_score, iou, precision, recall
label_desc: Use image node_id 8 for calling the Pipeline obj's underlying member method code with example usage: obj.score(ts, anomaly_true, scoring) and returns: scoring_func, scoring_func