TRAILED: Topological Regularization and Integrity Learning for EHR Data
Project description
TRAILED: Topological Regularization and Integrity Learning for EHR Data
A high-performance Rust implementation of the Euler Characteristic Transform (ECT), exposed through ergonomic Python bindings. TRAILED provides the ECT foundation for topological analysis of structured data — including patient trajectories, point clouds, graphs, and simplicial complexes.
Overview
The Euler Characteristic Transform (ECT) is a provably injective topological descriptor — it encodes the shape of a dataset losslessly, without relying on coordinates or distance metrics. TRAILED implements a differentiable ECT, enabling it to be used as both a feature extractor and a training-time regularizer in deep learning pipelines.
This library is the open-source ECT core. It is designed to be embedded into larger systems that require topologically-aware representations of structured or sequential data.
Features
- Fast Rust core for ECT computation.
- Differentiable: supports forward and backward passes for use as a loss or layer.
- Native Python API for NumPy workflows.
- Optional integrations for scikit-learn, PyTorch, and dataframe libraries.
Installation
uv pip install -e .
# Optional extras
pip install trailed[sklearn] # scikit-learn transformers
pip install trailed[torch] # PyTorch layers
pip install trailed[dataframe] # pandas + polars
pip install trailed[all] # all optional dependencies
Quick Start
# NumPy
from trailed import compute_ect_from_numpy
ect = compute_ect_from_numpy(points, num_thetas=32, resolution=32)
# Scikit-learn
from trailed import EctTransformer
transformer = EctTransformer(num_thetas=32, resolution=32)
features = transformer.fit_transform(X) # X: (n_samples, n_points, n_dims)
# PyTorch
from trailed import EctConfig, EctLayer
layer = EctLayer(EctConfig(num_thetas=32, resolution=32))
ect = layer(data) # torch_geometric Data
Running Tests
uv sync --group tests
uv run pytest
Acknowledgment
This project builds on the original dect implementation and accompanying research.
@inproceedings{Roell24a,
title = {Differentiable Euler Characteristic Transforms for Shape Classification},
author = {Ernst R{\"o}ell and Bastian Rieck},
year = 2024,
booktitle = {International Conference on Learning Representations},
eprint = {2310.07630},
archiveprefix = {arXiv},
primaryclass = {cs.LG},
repository = {https://github.com/aidos-lab/dect-evaluation},
url = {https://openreview.net/forum?id=MO632iPq3I},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trailed-0.1.0.tar.gz.
File metadata
- Download URL: trailed-0.1.0.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c36199aeb675d6f05fd221eb5ef1bb8a5d29ff3093896d69d77be1574815162
|
|
| MD5 |
a56793b84cb8a674a12157c1ce70fe24
|
|
| BLAKE2b-256 |
e547b669b38cf0984d955ed8665d76eaf650695499f03c7b2144979d22e9b60e
|
File details
Details for the file trailed-0.1.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: trailed-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 452.2 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd8a2672c315db2e4d181129876877702411280edea4f5661a9bba02055f3e26
|
|
| MD5 |
2e755ce0b8d35f03a92a5d876511e32d
|
|
| BLAKE2b-256 |
ad9a5d749bd98306d4f4e0cdb48969d65be240368c9daf6eb9aade8d81679d66
|