Skip to main content

tsmotifs

tsmotifs is an open-source Python framework for time-series motif discovery. It accompanies a systematic review and benchmark project and provides a shared implementation surface for comparing motif discovery methods without replacing their original scientific definitions.

The project is intended for researchers and practitioners who need consistent algorithm interfaces, reproducible experiment execution, and common evaluation utilities across a broad and otherwise fragmented literature.

Main features

  • A common MotifFinder interface and shared motif result representation.
  • Integrations and reconstructions spanning several families of motif discovery methods.
  • Versioned configuration, manifest generation, and runners for reproducible experiments.
  • Common result serialization, aggregation, and interval-based evaluation support.

Installation

Install the core library from PyPI:

pip install tsmotifs

Some methods need additional dependencies. Install the relevant extra when required:

pip install "tsmotifs[integrations]"
pip install "tsmotifs[visualization]"
pip install "tsmotifs[deep]"

The benchmark runners and their configurations are distributed in the source repository. For benchmark reproduction or development, clone the repository and install it in editable mode:

git clone https://github.com/kdis-lab/tsmotifs.git
cd tsmotifs
python -m pip install -e ".[benchmark]"

Use python -m pip install -e ".[dev]" to include the test and release-development tools.

Quick start

The following example uses the registered MK implementation on a small series containing a repeated subsequence:

import numpy as np

from tsmotifs import MK

series = np.array(
    [0, 1, 0, -1, 0, 1, 0, -1, 2, 2, 0, 1, 0, -1],
    dtype=float,
)

finder = MK(window_size=4)
motifs = finder.fit_discover(series, top_k=1)

for motif in motifs:
    print(motif.start, motif.length, motif.matches, motif.distance)

The common interface also exposes fit() and discover() separately. Use tsmotifs.list_algorithms() to inspect the algorithms bootstrapped into the public registry.

Supported methods

The repository covers exact, approximate, symbolic, grammar-based, probabilistic, online, optimization/learning, segmentation, and deep-learning approaches. Coverage reflects the scope of the accompanying review; individual integrations can have method-specific dependencies, input constraints, or external runtime requirements.

The top-level registry is deliberately conservative so that import tsmotifs remains safe when optional dependencies are absent. The benchmark configuration under experiment/config/ is the source of truth for methods used in each experimental phase.

Reproducibility

The experiment/ tree contains the versioned configurations, manifest builders, execution runners, aggregation code, and Slurm support used by the review benchmark. See the experimental pipeline and the HPC runbook before reproducing experiments.

Benchmark datasets and generated results are intentionally not part of the PyPI wheel. A link to the companion project website and the paper's final bibliographic record will be added when they are public; until then, this repository is the canonical supporting software artifact.

Citation

If you use tsmotifs, cite the associated review paper once its bibliographic record is available and cite the software version used in your experiments. Machine-readable software citation metadata is provided in CITATION.cff.

Contributing

Bug reports, documentation improvements, packaging fixes, and carefully scoped algorithm integrations are welcome. Please read CONTRIBUTING.md before opening an issue or pull request. Changes that affect taxonomy, evaluation methodology, or benchmark protocols require explicit scientific review.

License

tsmotifs is distributed under the BSD 3-Clause License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsmotifs-0.1.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

tsmotifs-0.1.1-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file tsmotifs-0.1.1.tar.gz.

File metadata

  • Download URL: tsmotifs-0.1.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for tsmotifs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c96c3ab60e73391fcf23686257a3fa4ba126df0f861a87ab034343468d8b7180
MD5 6e549cb34a65d667e0732dec37b4153e
BLAKE2b-256 0b2f1156356a38908b9b79b7e56725ce46a55ea567898b94168629f80893bb16

See more details on using hashes here.

File details

Details for the file tsmotifs-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tsmotifs-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for tsmotifs-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff28d9e2fe38c70bb86c19cf50ce3f5ec86f62c72ba7d3b69d12e52389ea722a
MD5 6f6d66fa171a955b5eccf747d2dfd2eb
BLAKE2b-256 45ea56ffeb1f74d6c782c0950e1d832c08c3b60b7f07e3a6c9f4fe53cda6cc99

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

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