Skip to main content

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

Project description

Streaming ERAL Algorithm and application to Evolving Clustering

Introduction

The sERAL (Streaming Error In Alignment) algorithm is a state-of-the-art method designed for online 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 seral

Usage

The main entry point for the end user is Cluster class in seral.seral:

from seral.seral import Cluster as sERAL

searl = sERAL(sample=initial_sample, id=0)

The class constructor accepts two parameters:

  • sample - the initial sample to be used for the prototype calculation
  • id - the class identifier

The basic function call is:

import numpy as np
from seral.seral import Cluster as sERAL

data: list[np.ndarray] = [...]

seral: sERAL = sERAL(sample=data[0], id=id, alpha=0.5)
for sample in data[1:]:
    seral.add_sample(sample=sample)

prototype = seral.prototype
    

For full examples, please refer to the examples/ directory at our repository.

Demonstration

The following figure demonstrates sERAL 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 sERAL, and the resulting prototype is shown in the figure. sERAL demonstration

Examples

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

  • Notebook titled 01 sERAL demo demonstrates the sERAL prototyping method using the Trace dataset from UCR Archive.
  • Notebook titled 02 sERAL demo on industrial data downloads an industrial dataset from Mendeley Data [2], and calculates the prototypes for all classes.
  • Notebook titled 03 sERAL vs ERAL vs DBA vs SBD demonstrates the performance of sERAL, ERAL, DBA, and SBD algorithms on the industrial dataset from [2].
  • Notebook titled 04 Evolving Time Series Clustering demonstrates the application of sERAL in the Evolving Time Series Clustering method [1].

References

[1] Stržinar, Žiga; Škrjanc, Igor; Pratama, Mahardhika and Pregelj, Boštjan (2024), "Evolving Clustering of Time Series for Unsupervised Analysis of Industrial Data Streams", available at SSRN: https://ssrn.com/abstract=5026151
[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

seral-1.0.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

seral-1.0.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file seral-1.0.1.tar.gz.

File metadata

  • Download URL: seral-1.0.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for seral-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e36609eba97721a9622a471b87db99b3de18fce42a37e1d3997a07d8c7285364
MD5 6849152231746e3b1a436688dc1ec3fa
BLAKE2b-256 76e32d8ddb6e9b4ac40175f0426b08374b14e1797762ca12c5afb722cd5dc91e

See more details on using hashes here.

File details

Details for the file seral-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: seral-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for seral-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb2783d884bacb5e93c5cddac68f19b4f65333ea57891d19afccdd7c31dcb66e
MD5 c13bc715916441c1c60dea932a85eeec
BLAKE2b-256 ac4ed58eee8b387f40d72477b3b90cf624313d8ede6e244c81f537413db102ad

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