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
0stores time values; and - columns
1throughnstore 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
1throughnin 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
icontains(birth, death)pairs for homology dimensioni.
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 ofhorizontal,sloped,sigmoid,arctanslope: controls the non-horizontal sweeping function forsloped/sigmoid/arctanpadding_factor: stabilization padding used bysigmoidandarctanuse_extended_persistence: switch between extended and ordinary persistencemin_persistence: persistence threshold for filtering generatorsdrop_inf_persistence: drop infinite-lifespan generators for ordinary persistence outputn_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)
| File | Size | Uploaded | |
|---|---|---|---|
| time_series_homology-0.1.0.tar.gz | 10.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|