Topologyx
Topological Data Analysis Routines
Install / Use
/learn @merylldindin/TopologyxREADME
<summary>Table of Contents</summary>
<ol> <li><a href="#about-topologyx">About TopologyX</a></li> <li><a href="#built-with">Built With</a></li> <li><a href="#get-started">Get Started</a></li> </ol>About TopologyX
Topological Data Analysis, also abbreviated TDA, is a recent field that emerged from various works in applied topology and computational geometry. It aims at providing well-founded mathematical, statistical, and algorithmic methods to exploit the topological and underlying geometric structures in data. My aim is to develop some tools in this repository that may be applied to data science in general. Some of them have already proven useful for classification tasks.
Read more about applied TDA:
- General introduction to TDA
- Medium article with general TDA overview
- Medium article about TDA for clustering
- Paper on applied TDA for arrhythmia detection
Built With
Get Started
pip install topologyx
# or with uv
uv add topologyx
How To Use
from topologyx.filtrations import Filtration
filtration = Filtration(data, use_alpha=False)
filtration.build_persistence_diagram(filtration_type=FiltrationType.SIMPLE, dimension=0)
from topologyx.clustering import TomatoClustering
tomato = TomatoClustering(data)
_ = tomato.estimate_clusters(visualize=True)
_ = tomato.fit_predict(n_clusters=3, visualize=True)
Local Installation
git clone https://github.com/merylldindin/topologyx
# install dependencies
make setup
Using Examples
Examples are provided as Marimo notebooks - reactive Python notebooks that are git-friendly (pure .py files). Launch the example server with:
make marimo
Filtration of a 3D shape: examples/filtrations.py demonstrates how to handle three-dimensional shapes using height as a filtration function, showing persistence diagrams, Betti curves, and persistence landscapes.
ToMaTo clustering: examples/clustering.py showcases TDA's strength for clustering - detecting centroids and recording relationships between points across various data distributions.
