Skip to main content

Python package for the MMD Critic method

Project description

mmd-critic

License

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.

Installation

You can install the package via pip:

pip install mmd-critic

Usage

from 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

More Info

Read my article for more info on the MMD critic method. I also encourage you to read the original paper.

Acknowledgements

The implementation here is based on Been Kim's original implementation and paper

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmd_critic-0.1.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

mmd_critic-0.1.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file mmd_critic-0.1.1.tar.gz.

File metadata

  • Download URL: mmd_critic-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for mmd_critic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 53bf15965c193807ce4a8a587fb05fca3ca362cbd1589e844d7fa14312dd6ae7
MD5 909774446b070ecd0d86d31f4f5a7a0b
BLAKE2b-256 cb385ce1f9c747548be98f15c0223bf74f71fe25cff6aaa7fd4b033bde2ee178

See more details on using hashes here.

File details

Details for the file mmd_critic-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mmd_critic-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for mmd_critic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4311ab17799168abe14cf2f71536f4ffd36925b4c292f791667ea7740e866453
MD5 adbaffe48d5d38c1b0fa01792ee260df
BLAKE2b-256 3d5d08bddf4f4fe04dcf439fc798d4785bcd4a1daa828bbd558a3be414cc80c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page