skillfed

scikit-survival

Survival analysis built on top of scikit-learn

scikit-survival v0.28.0 280.1K downloads/30d#8,115 on PyPI1,316
Copyleft license GPL-3.0-or-later Active released

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-survival

uv

uv add scikit-survival

poetry

poetry add scikit-survival

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: C++Programming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Software Development

Tags

survival analysis pythontime-to-event modelingcensored data analysisreliability analysis machine learningscikit-learn survival modelsright censoring predictionevent time prediction
survival-analysistime-to-eventcensored-data

More Software Development packages