Skip to main content

No project description provided

Project description

trendalation

An anomaly detection package for all sorts of trends & time series data. The library leverages algorithms like procrustes analysis to compare and contrast the general shape & trajectory of different trends. The procrustses analysis technique could be leveraged to get the minimum possible mean squared error between 2 distributions (after mathematical transformations). Using the training dataset, an ideal reference trace is determined for comparision along with a classification threshold from the generated error distribution using procrustes against this reference curve.

before_proc_demo after_proc_demo

Installation

Dependencies

trendalation requires:

  • Python (>= 3.8)
  • NumPy (>= 1.25.0)
  • Scikit-Learn (>=1.3.0)
  • SciPy (>= 1.11.1)

Using pip

The easiest way to install trendalation is using pip: pip install trendalation

Documentation

Usage

To train a classifier on a collection of traces, a classifier can be trained on the trace distribution. The model sets up the necessary classification criterion by analyzing various population statistics and trends. eg-

from trendalation.classification import ProcClassifier
clf = ProcClassifier()
clf.fit()

To futher optimize the process to the classification criterion determination, additional (optional) training parameters can be provided-

  • y: The target values (binary class labels) as integers with 1 representing an anomaly. If provided, classifier is fitted only on "good" samples in an attempt to get higher errors with "bad" samples against the reference curve.
  • threshold: Provide a percentile value to determine the threshold value on the procrustes error distribution.
  • normalize: Option to normalize traces with respect to themselves before fitting. Useful when traces have highly variables ranges. For example, stock prices.
  • ci_width: Confidence interval width parameter. Useful for approximating the location of the divergence or the anomaly on a trace.

The procrustes and trace normalizing functionality can be directly imported from the metric module-

from trendalation.metrics import procrustes
trace1_transformed, trace2_transformed, disparity = procrustes(trace1, trace2)

Help and Support

In order to report bugfixes and new feature requests, simply create a new issue on the repository. The issues will be reviewed by the authors on a regular basis & you're welcome to work on any open issues.

Contribution

This project is a community effort, and everyone is welcome to contribute. Feel free to work on any open issues and setup PRs.

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

trendalation-1.0.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trendalation-1.0.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file trendalation-1.0.2.tar.gz.

File metadata

  • Download URL: trendalation-1.0.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for trendalation-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4b030755256a723a27086b06876f4cc35c0283d0e9101c22753e4aaea426e942
MD5 57a31f927b5f63afbeaf6946270aa11e
BLAKE2b-256 03f5c33d677df475e2b0c770851abd5286e39f8d3bf15461944bb8919b9185fe

See more details on using hashes here.

File details

Details for the file trendalation-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: trendalation-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for trendalation-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d996108f56fb1b9822f8ae88bbfcb76acdcbbab4cba647ab8c53fde9c0ca8c00
MD5 b66ce01b9903ec4fc04d5e8e3d19f838
BLAKE2b-256 799acf3745efd517377504488b85466621488322d9df6150394821db9c0233a4

See more details on using hashes here.

Supported by

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