A method for detecting anomalies in univariate and multivariate data
Project description
Perception Anomaly Detection.
This project contains the prototypical implemenation of the algorithm described in the paper "Anomaly Detection using Principle of Human Perception" that can be found at: https://arxiv.org/abs/2103.12323
The perception algorithm detects global anomalies in univariate and multivariate data parameter-free! Just give it the standardised data as a numpy array and it will return the label (normal or anomalous) of each observation. The algorithm also gives each observation a score that can be useful for further analysis and investigation.
Notes on the algorithm:
Returns the anomaly label and associated score of each observation.
The greater the score, above zero, the more anomalous an observation is.
This function specialises to one-dimensional data when the data only has one feature.
The fundamental formula for scoring the unexpectedness of an observation is: (S choose n) * 1/(W^{n-1})
However, this formula is transformed for computational reasons as detailed in the accompanying paper and code to: -1/S * (log(S choose n) - (n - 1) * log(W))
In the multi-dimensional case:
We take in scaled data and calculate each observations' distance from the median using a distance measure, for example Mahalanobis or Euclidean. Then, given the one-dimensional data, we apply the one-dimensional anomaly detection algorithm as before.
The 'Notebooks' folder contains a getting started guide and tutorial examples that are recommended to be run and examined if new to this project: https://github.com/M-Nassir/perception
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for perception_nassir-0.0.5-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 512abf4844b5ae93b2bb3432382d7e80edadf4200af013b075738bc636447997 |
|
| MD5 | b52da8033f257a7de4aa7b7894d7f849 |
|
| BLAKE2b-256 | 3978c8cd4b8b187848977a039e383de974c8be80aa6bf837e59456c786c4ec84 |