A Python package for implementing the Maximum Mean Discrepancy Critic (MMD-Critic) method. This method is commonly used to find prototypes and criticisms (outliers, roughly speaking) in datasets.
You can install the package via pip:
pip install mmd-criticfrom mmd_critic import MMDCritic
from mmd_critic.kernels import RBFKernel
critic = MMDCritic(X, RBFKernel(sigma=1), criticism_kernel=RBFKernel(2), labels=y)
protos, proto_labels = critic.select_prototypes(50)
criticisms, criticism_labels = critic.select_criticisms(10, protos)Note that the labels and criticism_kernel are optional arguments which are None by default. If criticism_kernel
is none, then the prototype kernel will be used for criticisms. If labels are none, then returned labels will be None.
See more in the examples
Read my article for more info on the MMD critic method. I also encourage you to read the original paper.
The implementation here is based on Been Kim's original implementation and paper