# Build Survival Models with scikit-survival

Censored time-to-event data requires specialized preparation, modeling, and evaluation. This skill guides practical scikit-survival workflows from outcome encoding through model comparison.

## Install

```bash
npx skillstore add davila7/scikit-survival
```

## Metadata

- Status: approved
- Slug: davila7-scikit-survival
- Skillstore revision: r2
- Version status: missing
- Tree hash: cdef456f15681ea2907ecd42240f77e2cb7ac2be9b2b7dcff34e68acd313e126
- Author: davila7
- GitHub username: davila7
- License: MIT
- Repository: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/scikit-survival
- Ref: c43861a65bb95efcae259cd161c9d6f4dc7eec6f
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: scripts, external\_commands, network
- Quality score: 76
- Public page: https://skillstore.pages.dev/skills/davila7-scikit-survival
- Manifest: https://skillstore.pages.dev/api/skills/davila7-scikit-survival/manifest

## Capabilities

- Explains how to represent censored outcomes with scikit-survival structures.
- Guides selection among Cox, ensemble, and survival SVM models.
- Provides preprocessing workflows for missing, categorical, and scaled features.
- Compares concordance, time-dependent AUC, and Brier score metrics.
- Covers Kaplan-Meier, Nelson-Aalen, and competing-risks estimation.
- Shows cross-validation and hyperparameter-tuning patterns for survival models.

## Use Cases

- Analyze Clinical Follow-up Data: Prepare censored outcomes, fit interpretable Cox models, and evaluate discrimination under censoring.
- Compare Survival Algorithms: Benchmark Cox, forest, boosting, and SVM approaches with suitable survival metrics.
- Teach Time-to-Event Modeling: Create structured examples covering preprocessing, model assumptions, validation, and competing risks.

## Prompt Templates

### Choose a First Model

```
Recommend a scikit-survival model for my dataset. I have [rows], [features], [event rate], and [censoring rate]. Explain the choice.
```

### Prepare Survival Data

```
Design a preprocessing workflow for [dataset description]. Include outcome encoding, missing values, categorical features, scaling, splitting, and validation checks.
```

### Evaluate Competing Models

```
Plan a fair comparison of [model list] using my training and test data. Select censoring-aware metrics and explain each metric.
```

### Design a Competing-Risks Study

```
Design an advanced competing-risks analysis for [event types]. Address cumulative incidence, cause-specific modeling, validation, assumptions, and interpretation limits.
```

## Limitations

- The skill provides guidance and examples but does not execute analyses independently.
- Users must supply valid datasets, dependencies, and domain-specific event definitions.
- Clinical conclusions require expert review and external validation.
- Some examples may require adaptation for installed scikit-survival versions.

## Best Practices

- Validate event indicators, time values, event counts, and censoring rates before fitting models.
- Keep preprocessing inside cross-validation and apply training transformations unchanged to test data.
- Report multiple censoring-aware metrics with assumptions, time horizons, and uncertainty.

## Anti Patterns

- Do not treat competing events as ordinary censoring when estimating event-specific probabilities.
- Do not select models using the test set or leak preprocessing across validation folds.
- Do not use Harrell's concordance index alone when censoring is high.

## Security Audit

- Audited at: 2026-07-23T15:04:33.81\+00:00
- Summary: All 90 static findings are false positives caused by Markdown syntax, ordinary Python imports, parameter-grid terminology, the CIF acronym, and documentation links. The reviewed files contain educational scikit-survival guidance without command execution, dynamic code construction, reconnaissance, prompt injection, or suspicious network behavior.

## Stats

- Views: 221
- Downloads: 8
- Favorites: 1
- Popularity score: 0
