Minimal tool for outliers detection on small samples set
Project description
Outlier Detector toolkit
This project features a set of tools for outlier detection, marking or filtering away samples as they come to your Python analysis code.
Most of the tools rely on double tailed Dixon's Q-test (https://en.wikipedia.org/wiki/Dixon%27s_Q_test).
TL;DR
I have a sample
, and a know data distribution
: is the sample an outlier?
sample = 2.7
distribution = [0.1, 1.1, 4.78, 2.0, 7.2, 5.3]
from outlier_detector.functions import is_outlier
print(is_outlier(distribution, sample))
I have a distribution
and I iterate over it: is the n-th sample
is an outlier?
distribution = [0.1, 1.1, 4.78, 2.0, 7.2, 5.3, 8.1, -4.1, 5.4]
from outlier_detector.detectors import OutlierDetector
od = OutlierDetector(buffer_samples=5)
for x in distribution:
print(od.is_outlier(x))
I have a generating object from which I pop
samples and I want only valid samples, rejecting outliers.
distribution = [0.1, 1.1, 4.78, 2.0, 7.2, 5.3, 8.1, -14.1, 5.4]
from outlier_detector.filters import filter_outlier
class MyGen:
def __init__(self):
self.cursor = -1
@filter_outlier()
def pop(self):
self.cursor += 1
return distribution[self.cursor]
g = MyGen()
while True:
try:
r = g.pop()
print(r)
except IndexError:
print('No more data')
Documentation
The toolkit is organized so you can exploit one of the following pattern in the easiest way possible:
functions
for static analysis, detectors
for objects with internal buffers, and filters
for decorators.
For documentation see doc file
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
outlier_detector-0.0.1.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for outlier_detector-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8e030f251a8a2595940cc4f5797660a0a69efbe3d90fcfbc9ce10533bff096e |
|
MD5 | 1dba14f9f87bb9345d862aac4682408c |
|
BLAKE2b-256 | cb5d4866b079c64f5b55a3ffbf910d79136f99bc163c72308d0d0fe8525bc299 |