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 install the package from pypi.org using pip:

pip install eral

Usage

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

from 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 eral.eral import obtain_prototype
from 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 at our repository.

Demonstration

The following figure demonstrates ERAL algorithm on a set of time series from the Trace dataset from UCR Archive. The dataset contains 100 time series, each with 275 samples. The time series are aligned and averaged using ERAL, and the resulting prototype is shown in the figure. ERAL demonstration

Examples

The examples/ directory at our repository 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] STRŽINAR, Žiga; PREGELJ, Boštjan; ŠKRJANC, Igor. Non-elastic time series fuzzy clustering for efficient analysis of industrial data sets. Applied Soft Computing, 2024, 112398, doi: 10.1016/j.asoc.2024.112398.
[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-1.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

eral-1.1.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eral-1.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.2

File hashes

Hashes for eral-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5002eba6c5b872e30cddcbe86ca2af9466607b90ed5d477877f737f03a940188
MD5 4c1e5d5bcc4d3ba4428e10f7bda9b3a3
BLAKE2b-256 df4060aa8a87c40688f819501827f767eab8713223ba9ccda9e4c5659974765e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eral-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.2

File hashes

Hashes for eral-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a898844bf2f966bb203975eb61fef1c812dcfa9d4f1027869febd02c25a4cdc
MD5 f16eb18ce817da49afd399e15738d993
BLAKE2b-256 574328cfbce37908254e2f2a6e8834ef270528b2de41afad3e59702752fedb5f

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