Implementation of the Lifetime Clustering (LTC) algorithm, as described in Efficient and robust topology-based clustering.
Graphical abstract of the LTC algorithm (zollner2026efficient, CC BY 4.0).This is a minimal example. See installation for how to install.
from ltcpy import LifetimeClustering
data = ... # data
eps = ... # radius
ltc = LifetimeClustering(eps) # initialize
ltc.fit(data) # cluster
labels = ltc.labels_ # get labelsCheck our demo notebook for more elaborated examples.
To use directly in Rust, add it with cargo add ltc-rs as a dependency to your Cargo.toml.
let x: Vec<Vec<f32>> = ...; // data
let eps: f32 = ...; // radius
let (labels, lifetime) = ltc_rs::fit(&x,eps); // clusterInstall with pip from PyPI with:
pip install ltcpyAlternatively, build from source with Rust and Maturin. To build and install the ltcpy package locally, run:
maturin develop -m ltc-py/Cargo.toml --release| Path | Content |
|---|---|
./assets |
Example data |
./ltc-py |
Python bindings |
./ltc-rs |
Rust implementation |
./scripts |
Notebook with examples, Python implementation |
@article{zollner2026efficient,
title = {Efficient and robust topology-based clustering},
author = {Johann Maximilian Zollner and Balthasar Teuscher and Wejdene Mansour and Martin Werner},
journal = {Pattern Recognition},
volume = {180},
pages = {114415},
year = {2026},
issn = {0031-3203},
doi = {https://doi.org/10.1016/j.patcog.2026.114415},
url = {https://www.sciencedirect.com/science/article/pii/S0031320326013804}
}This work was supported by the German Federal Ministry of Research, Technology and Space under grant number 16DKWN134.
The project is licensed under the Apache-2.0 license or opensource.org/licenses/Apache-2.0.
