class_docstr: Drift detector based on the partial MMD Distance.
  (see T. Viehmann: Partial Wasserstein and Maximum Mean Discrepancy distances
  for bridging the gap between outlier detection and drift detection,
  https://arxiv.org/abs/2106.01289 )
  Note: We recommend using dtype double as input for now.
  
  Args:
       fraction_to_match: fraction of x probability mass to be matched
       n_perm: number of bootstrap permutations to run to compute p-value (None for not returning a p-value)
       method: PartialKernelMMDDriftDetector.METHOD_TWOSTAGE, METHOD_APPROX, or METHOD_QP
class_docstr_tok: ["Drift","detector","based","on","the","partial","MMD","Distance",".","(","see","T.","Viehmann",":","Partial","Wasserstein","and","Maximum","Mean","Discrepancy","distances","for","bridging","the","gap","between","outlier","detection","and","drift","detection",",","https",":","\/\/arxiv.org\/abs\/2106.01289",")","Note",":","We","recommend","using","dtype","double","as","input","for","now",".","Args",":","fraction_to_match",":","fraction","of","x","probability","mass","to","be","matched","n_perm",":","number","of","bootstrap","permutations","to","run","to","compute","p-value","(","None","for","not","returning","a","p-value",")","method",":","PartialKernelMMDDriftDetector.METHOD_TWOSTAGE",",","METHOD_APPROX",",","or","METHOD_QP"]
code: def __init__(
      self,
      *,
      return_p_value=False,
      n_perm=1000,
      fraction_to_match=1.0,
      kernel=GaussianKernel(),
      method=METHOD_TWOSTAGE,
  ):
      super().__init__(return_p_value=return_p_value)
      self.fraction_to_match = fraction_to_match
      self.kernel = kernel
      self.n_perm = n_perm
      self.n_test = None
      self.scores = None
      if method == PartialKernelMMDDriftDetector.METHOD_TWOSTAGE:
          self.partial_mmd = partial_kernel_mmd_twostage
      elif method == PartialKernelMMDDriftDetector.METHOD_APPROX:
          self.partial_mmd = partial_kernel_mmd_approx
      elif method == PartialKernelMMDDriftDetector.METHOD_QP:
          self.partial_mmd = partial_kernel_mmd_qp
      else:  # pragma: no cover
          raise RuntimeError("Invalid Partial MMD method")
  
file_path: TorchDrift/torchdrift/detectors/partial_mmd.py
imports: from typing import Optional
  import torch
  from .mmd import GaussianKernel
  from .detector import Detector
  import torchdrift
  import warnings
label_desc: Use image node_id 1 to create a new PartialKernelMMDDriftDetector object from inherited base classes: Detector with example: obj = PartialKernelMMDDriftDetector()