docstr: Base class for multivariate online drift detectors.
  
  Parameters
  ----------
  x_ref
      Data used as reference distribution.
  ert
      The expected run-time (ERT) in the absence of drift. For the multivariate detectors, the ERT is defined
      as the expected run-time from t=0.
  window_size
      The size of the sliding test-window used to compute the test-statistic.
      Smaller windows focus on responding quickly to severe drift, larger windows focus on
      ability to detect slight drift.
  preprocess_fn
      Function to preprocess the data before computing the data drift metrics.
  x_ref_preprocessed
      Whether the given reference data `x_ref` has been preprocessed yet. If `x_ref_preprocessed=True`, only
      the test data `x` will be preprocessed at prediction time. If `x_ref_preprocessed=False`, the reference
      data will also be preprocessed.
  n_bootstraps
      The number of bootstrap simulations used to configure the thresholds. The larger this is the
      more accurately the desired ERT will be targeted. Should ideally be at least an order of magnitude
      larger than the ert.
  verbose
      Whether or not to print progress during configuration.
  input_shape
      Shape of input data.
  data_type
      Optionally specify the data type (tabular, image or time-series). Added to metadata.
docstr_tok: ["Base","class","for","multivariate","online","drift","detectors",".","Parameters","--","--","--","--","--","x_ref","Data","used","as","reference","distribution",".","ert","The","expected","run-time","(","ERT",")","in","the","absence","of","drift",".","For","the","multivariate","detectors",",","the","ERT","is","defined","as","the","expected","run-time","from","t=0",".","window_size","The","size","of","the","sliding","test-window","used","to","compute","the","test-statistic",".","Smaller","windows","focus","on","responding","quickly","to","severe","drift",",","larger","windows","focus","on","ability","to","detect","slight","drift",".","preprocess_fn","Function","to","preprocess","the","data","before","computing","the","data","drift","metrics",".","x_ref_preprocessed","Whether","the","given","reference","data","`","x_ref","`","has","been","preprocessed","yet",".","If","`","x_ref_preprocessed=True","`",",","only","the","test","data","`","x","`","will","be","preprocessed","at","prediction","time",".","If","`","x_ref_preprocessed=False","`",",","the","reference","data","will","also","be","preprocessed",".","n_bootstraps","The","number","of","bootstrap","simulations","used","to","configure","the","thresholds",".","The","larger","this","is","the","more","accurately","the","desired","ERT","will","be","targeted",".","Should","ideally","be","at","least","an","order","of","magnitude","larger","than","the","ert",".","verbose","Whether","or","not","to","print","progress","during","configuration",".","input_shape","Shape","of","input","data",".","data_type","Optionally","specify","the","data","type","(","tabular",",","image","or","time-series",")",".","Added","to","metadata","."]
code: def __init__(
      self,
      x_ref: Union[np.ndarray, list],
      ert: float,
      window_size: int,
      preprocess_fn: Optional[Callable] = None,
      x_ref_preprocessed: bool = False,
      n_bootstraps: int = 1000,
      verbose: bool = True,
      input_shape: Optional[tuple] = None,
      data_type: Optional[str] = None,
  ) -> None:
      """
      Base class for multivariate online drift detectors.
  
      Parameters
      ----------
      x_ref
          Data used as reference distribution.
      ert
          The expected run-time (ERT) in the absence of drift. For the multivariate detectors, the ERT is defined
          as the expected run-time from t=0.
      window_size
          The size of the sliding test-window used to compute the test-statistic.
          Smaller windows focus on responding quickly to severe drift, larger windows focus on
          ability to detect slight drift.
      preprocess_fn
          Function to preprocess the data before computing the data drift metrics.
      x_ref_preprocessed
          Whether the given reference data `x_ref` has been preprocessed yet. If `x_ref_preprocessed=True`, only
          the test data `x` will be preprocessed at prediction time. If `x_ref_preprocessed=False`, the reference
          data will also be preprocessed.
      n_bootstraps
          The number of bootstrap simulations used to configure the thresholds. The larger this is the
          more accurately the desired ERT will be targeted. Should ideally be at least an order of magnitude
          larger than the ert.
      verbose
          Whether or not to print progress during configuration.
      input_shape
          Shape of input data.
      data_type
          Optionally specify the data type (tabular, image or time-series). Added to metadata.
      """
      super().__init__()
  
      if ert is None:
          logger.warning(
              "No expected run-time set for the drift threshold. Need to set it to detect data drift."
          )
  
      self.ert = ert
      self.fpr = 1 / ert
      self.window_size = window_size
  
      # x_ref preprocessing
      self.x_ref_preprocessed = x_ref_preprocessed
      if preprocess_fn is not None and not isinstance(preprocess_fn, Callable):  # type: ignore[arg-type]
          raise ValueError("`preprocess_fn` is not a valid Callable.")
      if not self.x_ref_preprocessed and preprocess_fn is not None:
          self.x_ref = preprocess_fn(x_ref)
      else:
          self.x_ref = x_ref
  
      # Other attributes
      self.preprocess_fn = preprocess_fn
      self.n = len(x_ref)
      self.n_bootstraps = (
          n_bootstraps  # nb of samples used to estimate thresholds
      )
      self.verbose = verbose
  
      # store input shape for save and load functionality
      self.input_shape = get_input_shape(input_shape, x_ref)
  
      # set metadata
      self.meta["detector_type"] = "drift"
      self.meta["data_type"] = data_type
      self.meta["online"] = True
  
imports: import logging
  import warnings
  from abc import abstractmethod
  from typing import Any, Callable, Dict, List, Optional, Union, Tuple, TYPE_CHECKING
  import numpy
  from alibi_detect.base import BaseDetector, concept_drift_dict
  from alibi_detect.cd.utils import get_input_shape
  from alibi_detect.utils.state import StateMixin
  from alibi_detect.utils._types import Literal
label_desc: Use image node_id 1 to create a new BaseMultiDriftOnline object from inherited base classes: BaseDetector, StateMixin with example: obj = BaseMultiDriftOnline(x_ref, ert, window_size, preprocess_fn, x_ref_preprocessed, n_bootstraps, verbose, input_shape, data_type)