Scikit-survival

Latest version: v0.23.1

Safety actively analyzes 681881 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

0.23.1

This release adds support for Python 3.13. The minimum required version for pandas has been bumped to pandas 1.4.0.

Bug fixes

- Add SurvivalAnalysisMixin base class to [`sksurv.ensemble.ExtraSurvivalTrees`](https://scikit-survival.readthedocs.io/en/v0.23.0/api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees "sksurv.ensemble.ExtraSurvivalTrees") to enable the [`sksurv.ensemble.ExtraSurvivalTrees.score()`](https://scikit-survival.readthedocs.io/en/v0.23.0/api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees.score "sksurv.ensemble.ExtraSurvivalTrees.score") method that has been unintentially removed in 0.23.0 ([488](https://github.com/sebp/scikit-survival/issues/488)).


Enhancements

- Improve performance of [`sksurv.metrics.concordance_index_censored()`](https://scikit-survival.readthedocs.io/en/v0.23.0/api/generated/sksurv.metrics.concordance_index_censored.html#sksurv.metrics.concordance_index_censored "sksurv.metrics.concordance_index_censored") and [`sksurv.metrics.concordance_index_ipcw()`](https://scikit-survival.readthedocs.io/en/v0.23.0/api/generated/sksurv.metrics.concordance_index_ipcw.html#sksurv.metrics.concordance_index_ipcw "sksurv.metrics.concordance_index_ipcw") ([465](https://github.com/sebp/scikit-survival/issues/465)).


Backwards incompatible changes

- Support for pandas versions before 1.4.0 has been dropped.

**Full Changelog**: https://github.com/sebp/scikit-survival/compare/v0.23.0...v0.23.1

0.23.0

This release adds support for scikit-learn 1.4 and 1.5, which includes [missing value support](https://scikit-learn.org/1.5/modules/tree.html#tree-missing-value-support) for [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest).

Moreover, this release fixes critical bugs. When fitting [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree), the `sample_weight` is now correctly considered when computing the log-rank statistic for each split. This change also affects [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest) and [sksurv.ensemble.ExtraSurvivalTrees](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees) which pass `sample_weight` to the individual trees in the ensemble.

This release fixes a bug in [sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis.html#sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis) and [sksurv.ensemble.GradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis) when dropout is used. Previously, dropout was only applied starting with the third iteration, now dropout is applied in the second iteration too.

Finally, this release adds compatibility with numpy 2.0 and drops support for Python 3.8.

Bug fixes

* Fix issue with dropout in [sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis.html#sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis) and [sksurv.ensemble.GradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis), where it was only applied starting with the third iteration.
* Fix LogrankCriterion in [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree) to handle `sample_weight` correctly ([464](https://github.com/sebp/scikit-survival/issues/464)).

Enhancements

* Fix deprecations with pandas 2.2.
* Drop importlib-resources dependency.
* Add support for scikit-learn 1.4 ([441](https://github.com/sebp/scikit-survival/issues/441)).
* Add `warm_start` support to [sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis.html#sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis).
* Add missing values support to [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest).
* Add `require_y` tag to sksurv.base.SurvivalAnalysisMixin.
* Upgrade to ruff 0.4.3 ([456](https://github.com/sebp/scikit-survival/issues/456)).
* Add support for scikit-learn 1.5 ([461](https://github.com/sebp/scikit-survival/issues/461)).

Documentation

* Fix [sksurv.nonparametric.kaplan_meier_estimator()](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.nonparametric.kaplan_meier_estimator.html#sksurv.nonparametric.kaplan_meier_estimator) documentation to give correct default value for `conf_type` ([430](https://github.com/sebp/scikit-survival/issues/430)).
* Fix allowed values for kernel in [sksurv.svm.FastSurvivalSVM](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.svm.FastSurvivalSVM.html#sksurv.svm.FastSurvivalSVM) and [sksurv.svm.MinlipSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.svm.MinlipSurvivalAnalysis.html#sksurv.svm.MinlipSurvivalAnalysis) ([444](https://github.com/sebp/scikit-survival/issues/444)).
* Fix typo in API doc of [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest) and [sksurv.ensemble.ExtraSurvivalTrees](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees) ([446](https://github.com/sebp/scikit-survival/issues/446)).
* Fix API doc for the `criterion` parameter of [sksurv.ensemble.GradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis) ([449](https://github.com/sebp/scikit-survival/issues/449)).
* Update links to scipy, pandas and numpy documentation.
* Fix letter of hyper-parameter used in the formula for [sksurv.linear_model.IPCRidge](https://scikit-survival.readthedocs.io/en/v0.23.0//api/generated/sksurv.linear_model.IPCRidge.html#sksurv.linear_model.IPCRidge) ([454](https://github.com/sebp/scikit-survival/issues/454)).
* Upgrade Sphinx to 7.3 and pydata-sphinx-theme to 0.15 ([455](https://github.com/sebp/scikit-survival/issues/455)).

Backwards incompatible changes

* Drop support for Python 3.8 ([427](https://github.com/sebp/scikit-survival/issues/427)).

New Contributors
* CaderIdris made their first contribution in https://github.com/sebp/scikit-survival/pull/430

**Full Changelog**: https://github.com/sebp/scikit-survival/compare/v0.22.2...v0.23.0

0.22.2

This release adds support for Python 3.12.

Bug fixes

- Fix invalid escape sequence in [Introduction](https://scikit-survival.readthedocs.io/en/v0.22.2/user_guide/00-introduction.html) of user guide.

Enhancements

- Mark Cython functions as noexcept ([418](https://github.com/sebp/scikit-survival/issues/418)).
- Add support for Python 3.12 ([422](https://github.com/sebp/scikit-survival/issues/422)).
- Do not use deprecated is_categorical_dtype() of Pandas API.

Documentation

- Add section [Building Cython Code](https://scikit-survival.readthedocs.io/en/v0.22.2/contributing.html#building-cython-code) to contributing guidelines ([379](https://github.com/sebp/scikit-survival/issues/379)).
- Improve the description of the estimate parameter in [sksurv.metrics.brier_score()](https://scikit-survival.readthedocs.io/en/v0.22.2/api/generated/sksurv.metrics.brier_score.html#sksurv.metrics.brier_score) and [sksurv.metrics.integrated_brier_score()](https://scikit-survival.readthedocs.io/en/v0.22.2/api/generated/sksurv.metrics.integrated_brier_score.html#sksurv.metrics.integrated_brier_score) ([424](https://github.com/sebp/scikit-survival/issues/424)).

**Full Changelog**: https://github.com/sebp/scikit-survival/compare/v0.22.1...v0.22.2

0.22.1

Bug fixes

- Fix error in [sksurv.tree.SurvivalTree.fit()](https://scikit-survival.readthedocs.io/en/v0.22.1/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree.fit) if `X` has missing values and dtype other than float32 ([412](https://github.com/sebp/scikit-survival/issues/412)).

0.22.0

This release adds support for scikit-learn 1.3, which includes [missing value support](https://scikit-learn.org/1.3/modules/tree.html#tree-missing-value-support) for [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree). Support for previous versions of scikit-learn has been dropped.

Moreover, a low_memory option has been added to [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest), [sksurv.ensemble.ExtraSurvivalTrees](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees), and [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree) which reduces the memory footprint of calling predict, but disables the use of `predict_cumulative_hazard_function` and `predict_survival_function`.

Bug fixes

- Fix issue where an estimator could be fit to data containing negative event times ([410](https://github.com/sebp/scikit-survival/issues/410)).

Enhancements

- Expand test_stacking.py coverage w.r.t. `predict_log_proba` ([380](https://github.com/sebp/scikit-survival/issues/380)).
- Add `low_memory` option to [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest), [sksurv.ensemble.ExtraSurvivalTrees](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees), and [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree). If set, predict computations use less memory, but `predict_cumulative_hazard_function` and `predict_survival_function` are not implemented ([369](https://github.com/sebp/scikit-survival/issues/369)).
- Allow calling [sksurv.meta.Stacking.predict_cumulative_hazard_function()](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.meta.Stacking.html#sksurv.meta.Stacking.predict_cumulative_hazard_function) and [sksurv.meta.Stacking.predict_survival_function()](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.meta.Stacking.html#sksurv.meta.Stacking.predict_survival_function) if the meta estimator supports it ([388](https://github.com/sebp/scikit-survival/issues/388)).
- Add support for missing values in [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree) based on missing value support in scikit-learn 1.3 ([405](https://github.com/sebp/scikit-survival/issues/405)).
- Update bundled Eigen to 3.4.0.

Documentation

- Add [sksurv.meta.Stacking.unique_times_](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.meta.Stacking.html#sksurv.meta.Stacking.unique_times_) to API docs.
- Upgrade to Sphinx 6.2.1 and pydata_sphinx_theme 0.13.3 ([390](https://github.com/sebp/scikit-survival/issues/390)).

Backwards incompatible changes

- The `loss_` attribute of [sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis.html#sksurv.ensemble.ComponentwiseGradientBoostingSurvivalAnalysis) and [sksurv.ensemble.GradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis) has been removed ([402](https://github.com/sebp/scikit-survival/issues/402)).

- Support for `max_features='auto'` in [sksurv.ensemble.GradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis) and [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.22.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree) has been removed ([402](https://github.com/sebp/scikit-survival/issues/402)).

**Full Changelog**: https://github.com/sebp/scikit-survival/compare/v0.21.0...v0.22.0

0.21.0

This is a major release bringing new features and performance improvements.

- [sksurv.nonparametric.kaplan_meier_estimator()](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.nonparametric.kaplan_meier_estimator.html#sksurv.nonparametric.kaplan_meier_estimator) can estimate pointwise confidence intervals by specifying the `conf_type` parameter.
- [sksurv.ensemble.GradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis) supports early-stopping via the monitor parameter of [sksurv.ensemble.GradientBoostingSurvivalAnalysis.fit()](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis.fit).
- [sksurv.metrics.concordance_index_censored()](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.metrics.concordance_index_censored.html#sksurv.metrics.concordance_index_censored) has a significantly reduced memory footprint. Memory usage now scales linear, instead of quadratic, in the number of samples.
- Fitting of [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree), [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest), or [sksurv.ensemble.ExtraSurvivalTrees](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees) is about 3x faster.
- Finally, the release adds support for Python 3.11 and pandas 2.0.

Bug fixes

- Fix bug where times passed to [sksurv.metrics.brier_score()](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.metrics.brier_score.html#sksurv.metrics.brier_score) was downcast, resulting in a loss of precision that may lead to duplicate time points ([349](https://github.com/sebp/scikit-survival/issues/349)).
- Fix inconsistent behavior of evaluating functions returned by `predict_cumulative_hazard_function` or `predict_survival_function` ([375](https://github.com/sebp/scikit-survival/issues/375)).

Enhancements

- [sksurv.nonparametric.kaplan_meier_estimator()](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.nonparametric.kaplan_meier_estimator.html#sksurv.nonparametric.kaplan_meier_estimator) and [sksurv.nonparametric.CensoringDistributionEstimator](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.nonparametric.CensoringDistributionEstimator.html#sksurv.nonparametric.CensoringDistributionEstimator) support returning confidence intervals by specifying the `conf_type` parameter ([348](https://github.com/sebp/scikit-survival/issues/348)).
- Configure package via pyproject.toml ([347](https://github.com/sebp/scikit-survival/issues/347)).
- Add support for Python 3.11 ([350](https://github.com/sebp/scikit-survival/issues/350)).
- Add support for early-stopping to [sksurv.ensemble.GradientBoostingSurvivalAnalysis](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.GradientBoostingSurvivalAnalysis.html#sksurv.ensemble.GradientBoostingSurvivalAnalysis) ([354](https://github.com/sebp/scikit-survival/issues/354)).
- Do not use deprecated pkg_resources API ([353](https://github.com/sebp/scikit-survival/issues/353)).
- Significantly reduce memory usage of [sksurv.metrics.concordance_index_censored()](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.metrics.concordance_index_censored.html#sksurv.metrics.concordance_index_censored) ([362](https://github.com/sebp/scikit-survival/issues/362)).
- Set criterion attribute in [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree) such that [sklearn.tree.plot_tree()](https://scikit-learn.org/1.2/modules/generated/sklearn.tree.plot_tree.html#sklearn.tree.plot_tree) can be used ([366](https://github.com/sebp/scikit-survival/issues/366)).
- Significantly improve speed to fit a [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree), [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest), or [sksurv.ensemble.ExtraSurvivalTrees](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees) ([371](https://github.com/sebp/scikit-survival/issues/371)).
- Expose `_predict_risk_score` attribute in [sklearn.pipeline.Pipeline](https://scikit-learn.org/1.2/modules/generated/sklearn.pipeline.Pipeline.html#sklearn.pipeline.Pipeline) if the final estimator of the pipeline has such property ([374](https://github.com/sebp/scikit-survival/issues/374)).
- Add support for pandas 2.0 ([373](https://github.com/sebp/scikit-survival/issues/373)).

Documentation

- Fix wrong number of selected features in the guide [Introduction to Survival Analysis](https://scikit-survival.readthedocs.io/en/v0.21.0/user_guide/00-introduction.html) ([#345](https://github.com/sebp/scikit-survival/issues/345)).
- Fix broken links with nbsphinx 0.9.2 ([367](https://github.com/sebp/scikit-survival/issues/367)).

Backwards incompatible changes

- The attribute `event_times_` of estimators has been replaced by `unique_times_` to clarify that these are all the unique times points, not just the once where an event occurred ([371](https://github.com/sebp/scikit-survival/issues/371)).
- Functions returned by `predict_cumulative_hazard_function` and `predict_survival_function` of [sksurv.tree.SurvivalTree](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.tree.SurvivalTree.html#sksurv.tree.SurvivalTree), [sksurv.ensemble.RandomSurvivalForest](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.RandomSurvivalForest.html#sksurv.ensemble.RandomSurvivalForest), and [sksurv.ensemble.ExtraSurvivalTrees](https://scikit-survival.readthedocs.io/en/v0.21.0/api/generated/sksurv.ensemble.ExtraSurvivalTrees.html#sksurv.ensemble.ExtraSurvivalTrees) are over all unique time points passed as training data, instead of all unique time points where events occurred ([371](https://github.com/sebp/scikit-survival/issues/371)).
- Evaluating a function returned by `predict_cumulative_hazard_function` or `predict_survival_function` will no longer raise an exception if the specified time point is smaller than the smallest time point observed during training. Instead, the value at `StepFunction.x[0]` will be returned ([375](https://github.com/sebp/scikit-survival/issues/375)).

New Contributors
* dor132 made their first contribution in https://github.com/sebp/scikit-survival/pull/345
* cpoerschke made their first contribution in https://github.com/sebp/scikit-survival/pull/358

**Full Changelog**: https://github.com/sebp/scikit-survival/compare/v0.20.0...v0.21.0

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.