Skip to main content

A set of python modules for anomaly detection

Project description

https://travis-ci.org/Y-oHr-N/kenchi.svg?branch=master https://ci.appveyor.com/api/projects/status/5cjkl0jrxo7gmug0/branch/master?svg=true https://coveralls.io/repos/github/Y-oHr-N/kenchi/badge.svg?branch=master https://codeclimate.com/github/Y-oHr-N/kenchi/badges/gpa.svg https://badge.fury.io/py/kenchi.svg https://anaconda.org/Y_oHr_N/kenchi/badges/version.svg https://readthedocs.org/projects/kenchi/badge/?version=latest

kenchi

This is a set of python modules for anomaly detection.

Dependencies

  • Python (>=3.6)

  • matplotlib (>=2.1.1)

  • networkx (>=2.0)

  • numpy (>=1.14.0)

  • scikit-learn (>=0.19.1)

  • scipy (>=1.0.0)

Installation

You can install via pip

pip install kenchi

or conda.

conda install -c y_ohr_n kenchi

Anomaly detection methods

  1. FastABOD [6]

  2. MiniBatchKMeans

  3. KNN [1], [8]

  4. OneTimeSampling [9]

  5. LOF [2]

  6. IForest [7]

  7. PCA

  8. GMM

  9. HBOS [3]

  10. KDE

  11. SparseStructureLearning [4]

Examples

import matplotlib.pyplot as plt
from kenchi.datasets import load_wdbc
from kenchi.outlier_detection import *

# Load the breast cancer wisconsin dataset
X, y      = load_wdbc(random_state=0)

f, ax     = plt.subplots()
detectors = [
    FastABOD(),
    MiniBatchKMeans(random_state=0),
    LOF(),
    KNN(),
    IForest(random_state=0),
    PCA(),
    KDE()
]

for det in detectors:
    # Fit the model, and plot the ROC curve
    det.fit(X).plot_roc_curve(X=None, y=y, ax=ax)

plt.show()
https://raw.githubusercontent.com/Y-oHr-N/kenchi/master/docs/images/plot_roc_curve.png

License

BSD 3-Clause “New” or “Revised” License

Copyright (c) 2018, Kon

References

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

kenchi-0.9.0.tar.gz (4.8 MB view hashes)

Uploaded Source

Built Distribution

kenchi-0.9.0-py3-none-any.whl (40.3 kB view hashes)

Uploaded Python 3

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