Skip to main content

time-series-homology

Compute persistent homology for univariate or multivariate time series using horizontal and non-horizontal filtrations, as described in [1] and [2], respectively.

The main entry point is tsh.TimeSeriesHomology, which largely follows the API conventions from scikit-learn.

Installation

Install from PyPI:

pip install -U time-series-homology

Install from source:

git clone https://github.com/m-a-huber/time-series-homology.git
cd time-series-homology
pip install -e .

Quick start

import numpy as np
from tsh import TimeSeriesHomology

# A univariate time series represented as (time, value) pairs
t = np.linspace(0, 4 * np.pi, 200)
ts = np.column_stack([t, np.sin(t)])

model = TimeSeriesHomology(
    filtration_type="horizontal",
    use_extended_persistence=True,
)

# Input is a list of time series; each element is an array of shape
# (n_time_steps, n_features + 1), where column 0 is time.
persistence = model.fit_transform([ts])

Input and output format

Input:

  • A list of arrays, where each array has shape (n_time_steps, n_features + 1);
  • column 0 stores time values; and
  • columns 1 through n store the signal coordinates.

Output:

  • An object of type list[list[list[list[np.ndarray]]]], where the first axis indexes input time series;
  • the second axis indexes signal coordinates (that is, columns 1 through n in each input array);
  • the third axis indexes diagram families (ordinary/relative/essential for extended persistence, ordinary only otherwise); and
  • the fourth axis indexes homology dimensions, so that the array at index i contains (birth, death) pairs for homology dimension i.

When use_extended_persistence=True, each coordinate returns three diagram families (ordinary, relative, essential). Otherwise, ordinary persistence is used and it returns one family.

Key parameters

  • filtration_type: one of horizontal, sloped, sigmoid, arctan
  • slope: controls the non-horizontal sweeping function for sloped/sigmoid/arctan
  • padding_factor: stabilization padding used by sigmoid and arctan
  • use_extended_persistence: switch between extended and ordinary persistence
  • min_persistence: persistence threshold for filtering generators
  • drop_inf_persistence: drop infinite-lifespan generators for ordinary persistence output
  • n_jobs: parallel processing setting via joblib

For details, use:

from tsh import TimeSeriesHomology
help(TimeSeriesHomology)

References

[1] Lara Ost, Sebastiano Cultrera di Montesano, and Herbert Edelsbrunner. Banana Trees for the Persistence in Time Series Experimentally. 41st International Symposium on Computational Geometry (SoCG 2025). https://doi.org/10.4230/LIPIcs.SoCG.2025.71

[2] Marius Huber, David Robert Reich, and Lena Ann Jäger. 2026. Fixation Sequences as Time Series: A Topological Approach to Dyslexia Detection. In Proceedings of the 2026 Symposium on Eye Tracking Research and Applications (ETRA '26). Association for Computing Machinery, New York, NY, USA, Article 12, 1–13. https://doi.org/10.1145/3797246.3803045

Metadata

Release files for time-series-homology 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for time-series-homology 0.1.0
File Size Uploaded
time_series_homology-0.1.0.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for time-series-homology 0.1.0
File Interpreter ABI Platform
time_series_homology-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / time_series_homology-0.1.0.tar.gz

Download URL time_series_homology-0.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9d70addfcc5cf38dd1bec51273d03dce1f43812f86059f9678a1589db64d618c
BLAKE2b-256 checksum
How to use checksums
5fcacbd4e1dc62ba6200a138902e525eb5413e1002f81ae3850e412da44c042d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / time_series_homology-0.1.0-py3-none-any.whl

Download URL time_series_homology-0.1.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04fafe2f28c94c544ab459911c00327e1b6fd4e7c3e01cc4601f6833abc672ee
BLAKE2b-256 checksum
How to use checksums
267e8b92efc0dea415734060162d149888c7b7dcc2e4159693028233fdb9afec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page