scikit-survival Workflow Skill
An expert-level guide for building, tuning, and auditing right-censored and competing-risk survival models with scikit-survival.
Data & AnalyticsAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
Covers the full survival-analysis lifecycle against scikit-survival 0.28.0:
- Correct outcome construction: structured (event bool, time float) arrays via
Surv.from_arrays/Surv.from_dataframe - Leakage-safe pipelines: split first, fit imputers/encoders/scalers only on training folds inside a
ColumnTransformer - Model selection: Cox PH, Coxnet, IPCRidge, Random Survival Forest, Gradient Boosting, Survival SVMs — with each model's prediction semantics and limits
- Metric contracts: Harrell/Uno C-index and dynamic AUC take risk scores; Brier score and IBS take survival probabilities shaped
(n_test, n_times) - Competing risks: nonparametric cause-specific CIF, plus explicit warnings against misusing
1 - Kaplan-Meier - Five bundled local CLIs: CSV validation, training, metric evaluation, CIF, and Markdown reporting — network-free by default
Who it's for
- Clinical, epidemiological, and biostatistics researchers building prognostic models
- Data scientists working on time-to-event problems (churn, time-to-failure, relapse)
- Anyone who needs reproducible, defensible modeling procedures for papers or audits
- Less suitable if you lack a background in censoring and survival statistics
Examples
- Cox model on a clinical cohort: "Build a CoxPH pipeline from this CSV, tune alpha with nested CV, and report Uno's C and IBS" — the skill enforces split-before-preprocess and training-only censoring estimation.
- Competing-risk incidence: "Two causes of death here — plot cause-specific cumulative incidence" — guides integer status coding (0=censored, 1..K) and CIF row layout.
- Automated report: chain
train_survival_model.py→evaluate_survival_metrics.py→model_report.pyto produce a Markdown model report.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/scikit-survival folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/scikit-survival/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/scikit-survival ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and move to the folder where you keep tools.
- Clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Copy the skill into Claude's skills folder:
mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/scikit-survival ~/.claude/skills/ - Confirm Python 3.11 or newer:
python3 --version - Create and activate a virtual environment:
uv venv --python 3.11 && source .venv/bin/activate(install uv first withpip install uvif needed). - Install the pinned stack:
uv pip install "scikit-survival==0.28.0" "scikit-learn==1.9.0"plus the numpy/pandas/scipy pins listed in the skill. - Restart Claude Code and trigger it with prompts like "fit a survival model on this dataset" or "evaluate with time-dependent AUC".
- Note: upstream scikit-survival is GPL-3.0-or-later — review licensing before redistributing anything built on it.
View source on GitHub ↗License: MIT