Skip to main content

tausurv

Survival analysis for Python: nonparametric estimators, regression models, tree ensembles and neural networks behind one interface, with support for competing risks and minimal dependencies.

Documentation: https://scai-bio.github.io/tausurv/

Installation

pip install tausurv

Requires Python 3.12 or newer. Optional extras:

extra adds
tausurv[plot] plotting with matplotlib
tausurv[boost] SurvivalBoost, via scikit-learn
tausurv[tune] hyperparameter search and nested cross-validation, via Optuna
tausurv[deepsurv] the four DeepSurv benchmark tables stored as HDF5

The neural models in tausurv.nn need PyTorch, which is not installed automatically because the right build depends on your hardware. Install it first by following https://pytorch.org/get-started/locally/.

Example

import tausurv as ts

X, time, event = ts.datasets.load_dataset("pbc")
time = time / 365.25  # days -> years

km = ts.nonparametric.kaplan_meier(time, event)
km(5.0)  # 5-year survival, about 0.70

covariates = X.select("age", "bili", "albumin").to_numpy()
cox = ts.linear.CoxPH().fit(covariates, time, event)
cox.predict_survival_function(covariates[:3], [1.0, 5.0, 10.0])

What's included

  • Nonparametric: Kaplan-Meier, Nelson-Aalen, Aalen-Johansen, censoring distribution.
  • Regression: Cox proportional hazards, Fine-Gray, Weibull, log-normal and log-logistic AFT.
  • Trees: survival tree, random survival forest, gradient-boosted SurvivalBoost.
  • Neural: DeepSurv, DeepHit, DSM, logistic hazard, copula-based and HACSurv models.
  • Metrics: Harrell's, Uno's and Antolini's C-index, Brier score and integrated Brier score, time-dependent AUC, calibration.
  • Model selection: survival-aware splits, cross-validation, hyperparameter tuning and nested cross-validation.
  • Plotting: survival and cumulative-incidence curves with at-risk tables, forest plots, calibration, metrics over time.
  • Datasets: about 100 published cohorts that download on first use and are verified against a pinned checksum.

Development

The repository is a uv workspace. Install PyTorch into it with the build for your hardware, then sync:

uv pip install torch --index-url https://download.pytorch.org/whl/cpu
uv sync --all-packages --all-groups
uv run pytest

License

MIT. Developed at Fraunhofer SCAI.

Metadata

Release files for tausurv 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tausurv 0.1.0
File Size Uploaded
tausurv-0.1.0.tar.gz 216.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tausurv 0.1.0
File
tausurv-0.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
tausurv-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details
tausurv-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl CPython 3.12 abi3 Linux musl 1.2+ ARM64 Details
tausurv-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details
tausurv-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details
tausurv-0.1.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
tausurv-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details

Total release size: 8.4 MB

Release files / tausurv-0.1.0.tar.gz

Download URL tausurv-0.1.0.tar.gz
Size 216.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c6b9562eb0d6483a5a2c5c7ef069b70f819fbb53c37fbce3316e099ded9153e2
BLAKE2b-256 checksum
How to use checksums
9bab805bd565b63f9e68c90a3d1b9c7c87c52371993c10765435b419831f32be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / tausurv-0.1.0-cp312-abi3-win_amd64.whl

Download URL tausurv-0.1.0-cp312-abi3-win_amd64.whl
Size 527.6 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7dc63ea3bd92b2ccb11426eec20132e506f9e1dbd15a8a7e3a1dcb6bcf8d66f8
BLAKE2b-256 checksum
How to use checksums
fdb2bc1f448144d13bc17d19800a79dded209f827bbff454df40ef0e3fe7df38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / tausurv-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL tausurv-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 1.7 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
68c38edb5ca3bc8d9ac8da669828b606604b8ec76dcdd571573239057a453460
BLAKE2b-256 checksum
How to use checksums
c1262dac76fb059f3e68a1821f4f230826cfe086523478375ec5c6a3a9ad76bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / tausurv-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl

Download URL tausurv-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl
Size 1.6 MB
Tags CPython 3.12 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
497e49aa6021d19a3dbca944820fde9ed38d9f9f307dc4b2574a02e9a40b242b
BLAKE2b-256 checksum
How to use checksums
4b1775dff1d72227df76113fb78489a394a0853b85786fb92509553a9d3375cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / tausurv-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tausurv-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c8c11c273b6aa75480adf607827cc57865eab299e9ba0a33766b5dad258c3d1c
BLAKE2b-256 checksum
How to use checksums
87d1fe951f28c27d9ad7018785d4c793acabd533140bdb3a406b4e2010239952
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / tausurv-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL tausurv-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ba0bc618ccdf018f61e1b000060e601be3802122c1e608d09c1748d904101b3d
BLAKE2b-256 checksum
How to use checksums
9c6bcf24b4bd1a78f4a6c42255567d659c2bfbeb2d9d3ab352ad9117e09ebcd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / tausurv-0.1.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL tausurv-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Size 636.7 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
277f7793fec87dbec173182191985cbfa3887289420af61abbcd23f0adcc7823
BLAKE2b-256 checksum
How to use checksums
81649c2b312e60a61c2d569f75268cf4c73999606c3baa7c226659cad612e546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / tausurv-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl

Download URL tausurv-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 643.8 kB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
cefa2c96e40b26e192e7864461e021eeec80a702e3aeb9a94032614596a455b2
BLAKE2b-256 checksum
How to use checksums
c7f35c991a65e4e41cabd59e07495b0fef35d32d1291615a66640b915a927dec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page