Skip to main content

Open-source library for probabilistic anomaly detection in time series

Project description

pycanari

Open-source library for probabilistic anomaly detection in time series

Installation

Create Miniconda Environment

  1. Install Miniconda by following these instructions

  2. Create a conda environment named canari:

    conda create --name canari python=3.10
    
  3. Activate conda environment:

    conda activate canari
    

Install pycanari

  1. Install pycanari

    pip install pycanari
    
  2. Search pycanari and download pycanari-0.0.2.tar.gz file from the lastest version

  3. Copy the downloaded pycanari-0.0.2.tar file to the your working folder

  4. Extract the pycanari-0.0.2.tar file using:

    tar -xvf pycanari-0.0.2.tar
    
  5. Set directory

    cd pycanari-0.0.2
    
  6. Run:

    conda install -c conda-forge libstdcxx-ng
    
  7. Install requirements:

    pip install -r requirements.txt
    
  8. Test pycanari package:

    python -m examples.toy_forecast
    

NOTE: Replace the name pycanari-0.0.2 with the corresponding version, e.g. pycanari-0.0.3

Code organization

for development purposes

canari
|
|----src
|    |----dataProcess (class) 
|    |      (v0) read data
|    |      (v0) resampling 
|    |      (v0) split data into train/validation/test sets 
|    |      (v0) normalization/unnormalization (from pytagi)
|    |      (v1) automated outliers removal 
|    |      (v1) save data 
|    |
|    |----common (class)
|    |      (v0) forward(1 sample)
|    |      (v0) backward(1 sample)
|    |      (v0) RTS(1 sample)
|    |      (v0) step()
|    |
|    |----base_component (class) (v0)
|    |----baseline_component (derived class)
|    |      (v0) LL(param_value, initial hidden states),LT, LA, LcT, LcA, TcA 
|    |      (v2) exponential smoothing
|    |----intervention_component (derived class)
|    |      (v1) LL, LT, LA
|    |      (v2) \theta for LSTM
|    |----LSTM_component (derived class) (v0)
|    |----periodic_component (derived class) (v0)
|    |----residual_component (derived class)
|    |      (v0) AR: deterministic
|    |      (v1) AR: online
|    |      (v2) BAR
|    |
|    |----base_model (class) (v0)
|    |----TAGI-LSTM/SSM model (derived class)
|    |      (v0) training: model.train(ts_data) (v0)
|    |                     goal: obtain TAGI-LSTM's weights and biases.
|    |      (v0) filter: model.filter(ts_data), recursively apply forward(1sample) and backward(1sample),
|    |                   goal: only update SSM's hidden states
|    |      (v0) forecast: model.forecast(ts_data), recursively apply forward(1sample)
|    |      (v0) smoother: model.smoother(ts_data), recursively apply forward(1sample), backward() and RTS()
|    |                     goal: smoothed estimates for SSM's hidden states, and LSTM's hidden and cell states
|    |      (v1) hyper-paramters grid-search: model.gridSearch()
|    |      (v1) save/load model/parameters: component wise
|    |      (v2) parallel computing with multiple seeds: model.seeds([1]) or model.seeds([1 2 3]).
|    |      (v2) online learning (David): model.onlineTrain()
|    |----SKF model (derived class)
|    |      (v0) filter: model.filter
|    |      (v0) forecast: model.forecast
|    |      (v0) smoother: model.smoother
|    |      (v1) hyper-paramters grid-search: model.gridSearch()
|    |      (v1) save/load model/parameters: component wise
|    |      (v2) parallel computing with multiple seeds: model.seeds([1]) or model.seeds([1 2 3]).
|    |----RL model (derived class) (v2)
|    |
|    |
|    |----metrics(Likelihood, log-likelihood (v0), MSE/RMSE, MAE, p50, p90 (v1))
|    |----dataVisualization (plot data, predictions, hidden states) (v0:basic, v1:advanced)
|    |----task
|           (v0) unit tests
|           (v1) synthetic data generation
|           (v2) benmarking on some datasetes
|
|----data
|----examples
|----unit_test
|----saved_results
|----saved_models

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

pycanari-0.0.2.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

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

pycanari-0.0.2-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file pycanari-0.0.2.tar.gz.

File metadata

  • Download URL: pycanari-0.0.2.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for pycanari-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6086e9e65a68bf0496156ab30e461565f47df9ef933dbad25e7803b8602a490b
MD5 8d2b7930bd3bec053a90f229ce324250
BLAKE2b-256 67278e22b4e54f51265e0b689832dcc9f8a265b1ca51d63f65da9db616ea3326

See more details on using hashes here.

File details

Details for the file pycanari-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pycanari-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for pycanari-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c03cc6b32f6466d04df82ffbbba4766a7b1e53c01a12c85b54453c4fd77e062
MD5 fde6309326b839159ad954ab36a59a15
BLAKE2b-256 be64bd3c1b78fd8abb4847af40c59ff2c710821dbaba02d470bdc8ccd8f6fc94

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