scikit-survival
Survival analysis built on top of scikit-learn
What it is and what it does
scikit-survival is a Python library for survival analysis—modeling the time until an event occurs when some observations are censored (only partially observed). Unlike standard machine learning, survival analysis must account for the fact that some training records contain incomplete event information, such as patients in a clinical study who remain event-free at the end of monitoring. The library builds on scikit-learn, allowing you to use familiar preprocessing, cross-validation, and model-selection workflows while fitting survival-specific models that handle this censoring.
The package requires modern Python (3.11 or later) and several numerical dependencies including numpy, scipy, pandas, and scikit-learn, plus optimization libraries ecos and osqp. Installation is straightforward on major platforms via conda-forge or pip, though a C/C++ compiler is needed for the compiled components.
Use it for:
- Clinical trials: predict time to patient recovery or adverse event while accounting for patients lost to follow-up.
- Equipment reliability: model time-to-failure for machinery or components with incomplete failure records.
- Customer churn: estimate time until customer departure when some customers remain active at study end.
- Employee retention: analyze time-to-resignation with censored records for still-employed staff.
- Loan default: predict time to default in credit portfolios where some loans mature without default.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
scikit-survival provides survival analysis models that handle censored data—where event times are only partially observed—built on top of scikit-learn's API and preprocessing tools.
Yes, if you need survival analysis and accept GPL-3.0-or-later copyleft licensing. The package is actively maintained, well-integrated with scikit-learn, and handles the statistical complexities of censored data. Medium install friction (compiled dependencies, version constraints) is manageable on standard platforms. Not suitable for proprietary software without GPL compliance review.
Install
scikit-survival on PyPI
pip
pip install scikit-survivaluv
uv add scikit-survivalpoetry
poetry add scikit-survivalInstalling scikit-survival
Before you install
Medium install friction due to compiled dependencies (C/C++ compiler required) and multiple numerical libraries. Active maintenance with a release 40 days ago; supports current Python versions (3.11–3.14) with prebuilt wheels across major platforms.
License in practice
GPL-3.0-or-later (copyleft): any derivative work or distribution must also be open-source under a compatible license. Acceptable for research and open-source projects; requires review before use in proprietary software.
Quickstart
pip install scikit-survival
import numpy
import pandas
from scikit-survival import linear_model
model = linear_model.CoxPHFitter()
model.fit(X, y)
Requires C/C++ compiler and numpy 2.0.0 or later, pandas 2.2.0 or later, scikit-learn 1.9, narwhals 2.0.1 or later.
Verify before relying
- Specific survival models available (e.g., Cox proportional hazards, Kaplan-Meier, random survival forests).
- Whether the package provides confidence intervals or uncertainty quantification for survival predictions.
- Support for competing risks or multi-state survival models beyond standard right-censored data.
- Performance characteristics on large datasets or real-time prediction scenarios.
Package facts
| License | GPL-3.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 9 — ecos, joblib, narwhals, numexpr, numpy, osqp, pandas, scipy, scikit-learn |
| Maintenance | actively maintained — 40 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 280,054/month — #8,115 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scikit_survival-0.28.0-cp311-cp311-macosx_10_13_x86_64.whl; scikit_survival-0.28.0-cp311-cp311-macosx_11_0_arm64.whl; scikit_survival-0.28.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; scikit_survival-0.28.0-cp311-cp311-win_amd64.whl; scikit_survival-0.28.0-cp312-cp312-macosx_10_13_x86_64.whl; scikit_survival-0.28.0-cp312-cp312-macosx_11_0_arm64.whl; scikit_survival-0.28.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; scikit_survival-0.28.0-cp312-cp312-win_amd64.whl; scikit_survival-0.28.0-cp313-cp313-macosx_10_13_x86_64.whl; scikit_survival-0.28.0-cp313-cp313-macosx_11_0_arm64.whl; scikit_survival-0.28.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; scikit_survival-0.28.0-cp313-cp313-win_amd64.whl; scikit_survival-0.28.0-cp314-cp314-macosx_10_15_x86_64.whl; scikit_survival-0.28.0-cp314-cp314-macosx_11_0_arm64.whl; scikit_survival-0.28.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; scikit_survival-0.28.0-cp314-cp314-win_amd64.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
lifelineslifelines implements survival analysis…
permissive · top 5,000 on PyPI
reliabilityReliability engineering and survival analysis…
copyleft · top 5,000 on PyPI
LifetimesLifetimes models customer behavior and predicts…
permissive · top 15,000 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
scikit-networkscikit-network provides graph algorithms and…
permissive · top 5,000 on PyPI
statsmodelsstatsmodels provides statistical models,…
permissive · top 1,000 on PyPI
forestciComputes confidence intervals and variance…
permissive · top 15,000 on PyPI
benchpotsBenchPOTS provides standardized preprocessing…
permissive · top 15,000 on PyPI
causallibCausallib estimates causal effects from…
permissive · top 5,000 on PyPI
imbalanced-learnProvides re-sampling techniques to address…
permissive · top 5,000 on PyPI