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

kenchi

This is a set of python modules for anomaly detection.

Requirements

  • numpy

  • scipy

  • scikit-learn

Installation

You can install via pip.

pip install kenchi

Usage

>>> import numpy as np
>>> from kenchi import GaussianDetector
>>> train_size = 1000
>>> test_size  = 100
>>> n_outliers = 10
>>> n_features = 10
>>> rnd        = np.random.RamdomState(0)
>>> X_train    = rnd.normal(size=(train_size, n_features))
>>> X_test     = np.concatenate(
...     (
...         rnd.normal(size=(test_size - n_outliers, n_features)),
...         rnd.uniform(-10.0, 10.0, size=(n_outliers, n_features))
...     )
... )
>>> det        = GaussianDetector(use_method_of_moments=True).fit(X_train)
>>> det.predict(X_test)
array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
       1, 1, 1, 1, 1, 1, 1, 1], dtype=int32)

License

The MIT License

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.0.2.tar.gz (4.4 kB view hashes)

Uploaded Source

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