class_docstr: Drift detector based on the kernel Maximum Mean Discrepancy (MMD) test.
  
  This is modelled after the MMD drift detection in
  S. Rabanser et al: *Failing Loudly: An Empirical Study of Methods for Detecting Dataset Shift* (NeurIPS), 2019.
  
  Note that our heuristic choice of the kernel bandwith is more closely aligned with that of the original MMD paper and code than S. Rabanser's.
  
  The default kernel is the unnormalized Gaussian (or Squared Exponential) kernel.
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",
      )
      if not compute_p_value:
          ood_score = kernel_mmd(
              base_outputs, outputs, n_perm=None, kernel=self.kernel
          )
          p_value = None
      elif self.n_test is None:
          ood_score, p_value = kernel_mmd(
              base_outputs,
              outputs,
              n_perm=self.n_perm,
              kernel=self.kernel,
          )
      else:
          torchdrift.utils.check(
              self.n_test == outputs.size(0),
              "number of test samples does not match calibrated number",
          )
          ood_score = kernel_mmd(
              base_outputs, outputs, n_perm=None, kernel=self.kernel
          )
          p_value = torch.igammac(
              self.dist_alpha,
              self.dist_beta * (ood_score - self.dist_min).clamp(min=0),
          )  # needs PyTorch >=1.8
  
      return ood_score, p_value
  
imports: from typing import Optional
  import torch
  from .None import Detector
  import torchdrift.utils
label_desc: Use image node_id 3 for calling the KernelMMDDriftDetector 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