class_docstr: Drift detector based on (multiple) Kolmogorov-Smirnov tests.
  
  This detector uses the Kolmogorov-Smirnov test on the marginals of the features
  for each feature.
  
  For scores, it returns the maximum score. p-values are computed with the
  Bonferroni correction of multiplying the p-value of the maximum score by
  the number of features/tests.
  
  This is modelled after the KS drift detection in
  S. Rabanser et al: *Failing Loudly: An Empirical Study of Methods for Detecting Dataset Shift* (NeurIPS), 2019.
code: def predict_shift_from_features(
      self,
      base_outputs: torch.Tensor,
      outputs: torch.Tensor,
      compute_score: bool,
      compute_p_value: bool,
      individual_samples: bool = False,
  ):
      torchdrift.utils.check(
          not individual_samples,
          "Individual samples not supported by MMD detector",
      )
      ood_score = ks_two_sample_multi_dim(outputs, self.base_outputs)
      # Like failing loudly suggests to return the minimum p-value under the
      # label Bonferroni correction, this would correspond to the maximum score
      # see the p-value computation below...
      ood_score = ood_score.max()
  
      if compute_p_value:
          nx, n_features = base_outputs.shape
          ny, _ = outputs.shape
          # multiply by n_features for Bonferroni correction.
          p_value = min(
              1.0, ks_p_value(nx, ny, ood_score.item()) * n_features
          )
          p_value = torch.as_tensor(p_value, device=ood_score.device)
      else:
          p_value = None
      return ood_score, p_value
  
file_path: TorchDrift/torchdrift/detectors/ks.py
imports: from typing import Optional
  import torch
  import numpy
  from .None import Detector
  import torchdrift.utils
label_desc: Use image node_id 1 for calling the KSDriftDetector obj's underlying member method code with example usage: obj.predict_shift_from_features(base_outputs, outputs, compute_score, compute_p_value, individual_samples) and returns: ood_score,  p_value