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

tausurv scikit-survival lifelines pycox hazardous
Nonparametric
Kaplan-Meier ✓ ✓ ✓
Nelson-Aalen ✓ ✓ ✓
Aalen-Johansen ✓ ✓ ✓
Left truncation (delayed entry) ✓ ✓
Log-rank test ✓ ✓
Parametric univariate fits ✓
Regression
Cox proportional hazards ✓ ✓ ✓
Penalized Cox (L1, L2, elastic net) ✓ ✓
Time-varying covariates ✓
Proportional-hazards test ✓
AFT (Weibull, log-normal, log-logistic) ✓ ✓
Aalen additive hazards ✓
Fine-Gray ✓
Trees and boosting
Survival tree ✓ ✓
Random survival forest ✓ ✓
Gradient boosting ✓ ✓ ✓
Competing-risks gradient boosting ✓ ✓
Survival support vector machine ✓
Neural networks
DeepSurv ✓ ✓
DeepHit, with competing risks ✓ ✓
Logistic hazard ✓ ✓
Cox-Time, MTLR, PC-Hazard ✓
Deep survival machines ✓
CopulaSurv (dependent censoring) ✓
HACSurv (dependent competing risks) ✓
Discrimination
Harrell's concordance ✓ ✓ ✓
Uno's concordance (IPCW) ✓ ✓
Antolini's time-dependent concordance ✓ ✓
Time-dependent AUC ✓ ✓
Prediction error and calibration
Brier score (IPCW) ✓ ✓ ✓ ✓
Integrated Brier score ✓ ✓ ✓ ✓
Censored negative log-likelihood ✓
CRPS ✓
Calibration curve ✓ ✓ ✓
D-calibration ✓
Competing-risks metrics
Cause-specific concordance ✓ ✓
Cause-specific Brier score ✓ ✓
Cause-specific AUC ✓
Cause-specific calibration ✓ ✓
Workflow
Survival-aware cross-validation and tuning ✓ partly
Nested cross-validation ✓
Save and load fitted models partly ✓ ✓ ✓ ✓
Bundled datasets ✓ ✓ ✓ ✓
Survival curves with at-risk tables ✓ ✓
Time-dependent SHAP plots ✓

Checked against scikit-survival 0.27.0, lifelines 0.30.3, pycox 0.3.0 and hazardous 0.2.0. The full comparison explains the partial cells.

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.2.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.2.0
File Size Uploaded Provenance Actions
tausurv-0.2.0.tar.gz 222.3 kB With provenance Details for tausurv-0.2.0.tar.gz

Built distributions (wheels)

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

Total release size: 8.4 MB

Release files / tausurv-0.2.0.tar.gz

Download URL tausurv-0.2.0.tar.gz
Size 222.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cfe74826b200156b9bbeb0a39ae64b4f6b96c741b29dd45ee7a709a908fecc92
BLAKE2b-256 checksum
How to use checksums
68f09050a057a50bf7edbb29272a315ff426585cbbcc94e39feffde4cc42b11a
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 Nov 11, 2026.

Transparency log

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

Download URL tausurv-0.2.0-cp312-abi3-win_amd64.whl
Size 532.5 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
41a66b6f480d60e6f1796798055dd79801c498f087692a0b227d5fbc23d1cd04
BLAKE2b-256 checksum
How to use checksums
4d1100512172c32494a96cd2e8af74a426209021b5e078fa835e668a30fcce81
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 Nov 11, 2026.

Transparency log

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

Download URL tausurv-0.2.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
8e3f2ad630b2087ba69ba466a4741efb6e370f4e3fb3c1c11ad5a973358bd886
BLAKE2b-256 checksum
How to use checksums
4097bc4a81be6ba4313e6d02aaddf6fe76c2e39060f649e75079e861defea756
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 Nov 11, 2026.

Transparency log

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

Download URL tausurv-0.2.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
cb9f04543edf745d24b61719e498df79170d9865e7d52d37305061a464b3603e
BLAKE2b-256 checksum
How to use checksums
34a9275ff31335c6a30a99333b1ff9e5f96b19fa30fc96f7506a2524a059fd0d
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 Nov 11, 2026.

Transparency log

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

Download URL tausurv-0.2.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_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
530588ec55983744ac70b6619bbd9a4229d896b31c2f906782f32c304a72c01c
BLAKE2b-256 checksum
How to use checksums
38b4dd59dbff2bd04533f049f05c311827449e955502601f8eb84ea9051f4baf
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 Nov 11, 2026.

Transparency log

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

Download URL tausurv-0.2.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
266acf2143d81c52d2dfb1255050708c33c9c73648e6c17b197698c64f75c6f5
BLAKE2b-256 checksum
How to use checksums
6b4d99e5e7d5fe05ac66096bc1add0f6f11adafbd1fd9844600d163d4a2a73e5
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 Nov 11, 2026.

Transparency log

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

Download URL tausurv-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Size 641.8 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9dcf97db4eb1f555159b4e0ea3ff259862f661215549a5f853ff30d539f9d48f
BLAKE2b-256 checksum
How to use checksums
0efd43b1f490e189c8c00c2aaa78812f9094aac4f66a03d0c83121727a267e10
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 Nov 11, 2026.

Transparency log

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

Download URL tausurv-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 648.6 kB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b01e94782df30bae725ac3b4d86be75cea8d8c6c40d90a1729e8c66d21499048
BLAKE2b-256 checksum
How to use checksums
e3dfedd14fef26a4960a46222e99d8167cdc4e4e862b421d1dc9b8ac86d60312
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 Nov 11, 2026.

Transparency log

Security for tausurv 0.2.0

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.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for tausurv-0.2.0.tar.gz

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 Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

8 release files Full provenance

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