scikit-survival

Model censored time-to-event outcomes and predict survival risks in Python.

46|4|Updated Apr 8, 2023
One-click install
npx skills add https://github.com/CRAG666/dotfiles --skill scikit-survival-crag666
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scikit-survival
Source: https://github.com/CRAG666/dotfiles/tree/main/skills/scikit-survival
Command: npx skills add https://github.com/CRAG666/dotfiles --skill scikit-survival-crag666

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

scikit-survival helps you analyze time-to-event outcomes when part of your data is censored, so you can model risk and event timing without biasing results.

Core Features & Use Cases

  • Censored survival modeling: Fit Cox proportional hazards (including penalized Cox), accelerated failure time (AFT) via IPCW Ridge, and modern machine-learning survival estimators.
  • Ensemble and SVM approaches: Train Random Survival Forests, Gradient Boosting for survival, and Survival SVM variants for discrimination tasks.
  • Correct evaluation with censoring: Compute Uno/Harrell concordance indices, time-dependent AUC, and Brier/Integrated Brier scores; support competing-risks cumulative incidence analysis.
  • Typical use: You have patient follow-up data where some patients are lost before events occur; you want to predict risk for relapse or death and report discrimination/calibration properly.

Quick Start

In your notebook, load your dataset, convert outcomes with sksurv.util.Surv, fit a CoxPHSurvivalAnalysis model, then evaluate it using concordance_index_ipcw.

Frequently Asked Questions about scikit-survival

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze time-to-event data with censored outcomes in Python?

To analyze time-to-event data with censored outcomes in Python, construct Surv targets and fit estimators like CoxPHSurvivalAnalysis to predict risk without biasing results from incomplete follow-up.

How do I evaluate survival models when some event times are censored?

Evaluate survival models with censored data using censoring-aware metrics like concordance_index_ipcw, cumulative_dynamic_auc, and integrated_brier_score to accurately measure discrimination and calibration.

Can I train machine learning models for survival analysis beyond the standard Cox model?

You can train Random Survival Forests, Gradient Boosting for survival, and Survival SVM variants to model censored time-to-event outcomes when standard Cox proportional hazards assumptions are insufficient.

What is the best way to handle competing risks in survival analysis?

Handle competing risks in survival analysis by applying cumulative incidence analysis to model the probability of specific events when patients face multiple mutually exclusive failure types.

Why does standard regression bias time-to-event predictions?

Standard regression biases time-to-event predictions because it ignores censored data, incorrectly treating lost subjects as event-free, which skews risk estimates and survival probabilities.

Does scikit-survival support penalized Cox models for high-dimensional covariates?

scikit-survival supports penalized Cox proportional hazards models and IPCW Ridge accelerated failure time models to manage high-dimensional covariates and prevent overfitting in survival predictions.