Skip to main content

Implementation of ERAL algorithm (Stržinar et al., 2024)

Project description

ERAL Algorithm

Introduction

The ERAL (Error In Alignment) algorithm is a state-of-the-art method designed for time series alignment and averaging. The method obtains the average time series (the prototype) from a set of time series (a class).

Installation

To use ERAL, please clone the git repository:

git clone https://repo.ijs.si/zstrzinar/eral.git

The repository contains a requirements file, ensure you have all the requirements

pip install -r requirements.txt

pip package

A pip package is being prepared and will be made available soon.

Usage

The main entry point for the end user is obtain_prototype method in eral.eral:

from src.eral.eral import obtain_prototype

class_prototype = obtain_prototype(...)

The function takes several arguments, most important are:

  • class_segments: a list of time series to be aligned and averaged
  • prototyping_function: determines how the average is computed, typically the function get_new_prototype_variable_clipping from eral.alignment_prototyping_functions can be used.
  • exclustion_zone: percentage of forbidden alignments (see [1])

The basic function call is:

import numpy as np
from src.eral.eral import obtain_prototype
from src.eral.alignment_prototyping_functions import get_new_prototype_variable_clipping

X: list[np.ndarray] = [...]  # Class data

class_prototype = obtain_prototype(X,
                                   prototyping_function=get_new_prototype_variable_clipping,
                                   exclusion_zone=0.2)

For full examples, please refer to the examples/ directory.

Examples

The examples/ directory contains Jupyter notebooks that illustrate different uses and capabilities of the ERAL algorithm. To run an example, navigate to the examples/ directory and execute the desired notebook.

  • Notebook titled 01 ERAL demo demonstrates the ERAL prototyping method using the Trace dataset from UCR Archive.
  • Notebook titled 02 ERAL demo on industrial data downloads an industrial dataset from Mendeley Data, and calculates the prototypes for all classes.
  • Notebook titled 03 Comparison compares ERAL to DBA, SSG and others, using implementations in tslearn

References

[1] Paper introducing ERAL [2] Stržinar, Žiga; Pregelj, Boštjan; Petrovčič, Janko; Škrjanc, Igor; Dolanc, Gregor (2024), “Pneumatic Pressure and Electrical Current Time Series in Manufacturing”, Mendeley Data, V2, doi: 10.17632/ypzswhhzh9.2, url: https://data.mendeley.com/datasets/ypzswhhzh9/2

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

eral-0.0.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

eral-0.0.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eral-0.0.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.3

File hashes

Hashes for eral-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ca6a8e9d85835c44ba358d2df67989f463615284dd92c8b744e50cebf77f89fd
MD5 b94f6c5521a1aca197818d73e683b7d6
BLAKE2b-256 2af9af8b27a8228ffc366b3358717b9f1adea88506d80f9194b5d48c0c0335c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eral-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.3

File hashes

Hashes for eral-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6e2f8048315477833f48e059d62d983b0cb1e1fd6240f5afbeace7080210985
MD5 81a7e15ece1e1b736d6fcc5d4835b0cd
BLAKE2b-256 8185179544a163a52d943dbda7cd5660befda97b40cc2d953c5f9f67dc9ec61d

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