Open Family Office Datasets Tickers Strategies Portfolios Research Posts About Changelog

scikit-survival: Time-to-Event Analysis on scikit-learn

Source

Citation. Sebastian Pölsterl. "scikit-survival: A Library for Time-to-Event Analysis Built on Top of scikit-learn". Journal of Machine Learning Research 21(212), 1–6, 2020. jmlr.org/papers/v21/20-729. The software is sebp/scikit-survival, version 0.28.0 of 5 July 2026, under GPL-3.0. Compared with lifelines (version 0.30.3 of 5 March 2026, MIT) and with statsmodels' duration module (BSD).

Status. Not applicable. It is under GPL-3.0, and the project is under MIT. The project's survival questions need a Kaplan–Meier curve and a cumulative incidence for competing risks. statsmodels has both, and #315 already proposes statsmodels as an optional extra. scikit-survival's machine-learning models would need many more strategies than the project has.

Read. Read on 2026-11-28. I read the JMLR paper in full, from the PDF with pdftotext. Through the GitHub API, I read version 0.28.0's file tree and the function lists of sksurv/nonparametric.py and sksurv/metrics.py, with the Brier score's docstring in full. I read lifelines' file list and the function list of its utils, and statsmodels' duration/survfunc.py function list. I didn't run any of them.

Summary

Claim. "An open-source Python package for time-to-event analysis fully compatible with scikit-learn". It includes "tools to evaluate model performance on censored time-to-event data".

Method.

Findings. The paper reports none, beyond its example: a Cox model on the WHAS500 heart-attack data, with a concordance index of 0.808.

The three libraries.

Library Licence Kaplan–Meier Competing risks Time-varying covariates Time-dependent Brier score
scikit-survival 0.28.0 GPL-3.0 yes cumulative incidence not found in the file list yes
lifelines 0.30.3 MIT yes Aalen–Johansen CoxTimeVaryingFitter not found in the file list
statsmodels duration BSD SurvfuncRight, with delayed entry CumIncidenceRight PHReg takes entry times no

Where the claims go beyond the evidence

The example splits at random. The paper's example uses train_test_split. That suits heart-attack patients, who are independent. It doesn't suit strategies, delistings or trades, which are ordered in time and share market conditions. A random split puts the future in the training set (#10).

The default score isn't proper. Harrell's concordance index ranks risk scores. It doesn't score the predicted probabilities, so a model can rank well and be badly calibrated. The time-dependent Brier score is a squared error on probabilities, the closer match to open_familyoffice/scoring.py (proper-scoring-rules.md). It stays proper only if its censoring weights are right.

Censoring must be independent. The Brier score's weights assume "censoring is random and independent of the features". In this project, that can fail. A strategy whose paper record looks weak may be stopped early, so its censoring depends on its edge.

Credit. The paper says plainly that censoring affects evaluation as well as training: "held-out data will be subject to censoring too". The docstring states the Brier score's assumption and its limits, and raises an error past the last training time.

Use in this repo

How long to paper trade (RQ5, #32). Each strategy's time origin is the day it enters paper trading. Its event is the day its verdict turns from promotion to rejection (open_familyoffice/verdict.py, #12). A strategy still passing today is censored at today. A Kaplan–Meier curve over the strategies then estimates how long candidates last. The sample size matters. With Greenwood's formula, and no censoring before the events:

Strategies Events Estimated share still passing 95% interval
10 3 0.70 0.42 to 0.98
30 10 0.67 0.50 to 0.84
100 30 0.70 0.61 to 0.79

So with a few strategies, the curve says little. It needs dozens of events before its interval is useful.

Delisting as competing risks. A listed firm leaves by bankruptcy, by acquisition or by a move to another market. These are competing risks: one rules out the others. Treating an acquisition as a censoring overstates the risk of bankruptcy. A cumulative incidence for each cause gives the share of firms that leave by each route. That share is what a survivorship correction needs (#231, #273), once a source of delistings with their causes exists.

No immortal time. A covariate measured after the time origin, used as if known at the start, leaks the future. One example is a strategy's Sharpe ratio over its whole paper record. Time-varying covariates must enter at the time they become known, as with any feature (#10).

Drawdown recovery is censored too. A record that ends inside a drawdown is censored, not recovered. A recovery time computed from completed drawdowns only is biased short (#8, #236).

The choice: statsmodels, behind #315's extra. Kaplan–Meier with delayed entry, cumulative incidence and a Cox model are all in statsmodels, under BSD. If the project ever needs a time-dependent Brier score, the formula in scikit-survival's docstring is a few lines in scoring.py. Its weights come from a Kaplan–Meier fit of the censoring times. lifelines (MIT) is a fallback, but its last release was in March 2026. scikit-survival's forests and boosting don't justify a GPL dependency for a sample this small.