Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI - Version Crates.io Version GitHub Actions Workflow Status

Lifetime Clustering (LTC)

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).

Example

This is a minimal example. See installation for how to install.

Python

from ltcpy import LifetimeClustering

data = ... # data
eps = ... # radius

ltc = LifetimeClustering(eps) # initialize
ltc.fit(data) # cluster

labels = ltc.labels_ # get labels

Check our demo notebook for more elaborated examples.

Rust

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); // cluster

Installation

Install with pip from PyPI with:

pip install ltcpy

Alternatively, build from source with Rust and Maturin. To build and install the ltcpy package locally, run:

maturin develop -m ltc-py/Cargo.toml --release

Layout

Path Content
./assets Example data
./ltc-py Python bindings
./ltc-rs Rust implementation
./scripts Notebook with examples, Python implementation

Reference

@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}
}

Funding

This work was supported by the German Federal Ministry of Research, Technology and Space under grant number 16DKWN134.

License

The project is licensed under the Apache-2.0 license or opensource.org/licenses/Apache-2.0.

About

Lifetime Clustering (LTC)

Resources

Stars

5 stars

Watchers

2 watching

Forks

Contributors

Languages