scikit-survival 0.15 Released

I am proud to announce the release if version 0.15.0 of scikit-survival, which brings support for scikit-learn 0.24 and Python 3.9. Moreover, if you fit a gradient boosting model with loss='coxph', you can now predict the survival and cumulative hazard function using the predict_cumulative_hazard_function and predict_survival_function methods.

The other enhancement is that cumulative_dynamic_auc now supports evaluating time-dependent predictions. For instance, you can now evaluate the predicted time-dependent risk of a RandomSurvivalForest rather than just evaluating the predicted total number of events per instance, which is what RandomSurvivalForest.predict returns.

All you have to do is create an array where the columns are the predictions at the time points you want to evaluate. The snippet below summarizes the idea:

from sksurv.ensemble import RandomSurvivalForest
from sksurv.metrics import cumulative_dynamic_auc

rsf = RandomSurvivalForest()
rsf.fit(X_train, y_train)

chf_funcs = rsf.predict_cumulative_hazard_function(X_test)
time_points = np.array([30, 60, …])
risk_scores = np.row_stack([
  chf(time_points) for chf in chf_funcs
])

aucs, mean_auc = cumulative_dynamic_auc(
  y_train, y_test, risk_scores, time_points
)

For a complete example, please have a look at the User Guide.

If you want to know about all changes in scikit-survival 0.15.0, please see the release notes.

As usual, pre-built conda packages are available for Linux, macOS, and Windows via

 conda install -c sebp scikit-survival

Alternatively, scikit-survival can be installed from source following these instructions.

Avatar
Sebastian Pölsterl
AI Researcher

My research interests include machine learning for time-to-event analysis, causal inference and biomedical applications.

Related