scikit-survival 0.25.0__cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. scikit_survival-0.25.0.dist-info/METADATA +185 -0
  2. scikit_survival-0.25.0.dist-info/RECORD +58 -0
  3. scikit_survival-0.25.0.dist-info/WHEEL +6 -0
  4. scikit_survival-0.25.0.dist-info/licenses/COPYING +674 -0
  5. scikit_survival-0.25.0.dist-info/top_level.txt +1 -0
  6. sksurv/__init__.py +183 -0
  7. sksurv/base.py +115 -0
  8. sksurv/bintrees/__init__.py +15 -0
  9. sksurv/bintrees/_binarytrees.cpython-310-x86_64-linux-gnu.so +0 -0
  10. sksurv/column.py +205 -0
  11. sksurv/compare.py +123 -0
  12. sksurv/datasets/__init__.py +12 -0
  13. sksurv/datasets/base.py +614 -0
  14. sksurv/datasets/data/GBSG2.arff +700 -0
  15. sksurv/datasets/data/actg320.arff +1169 -0
  16. sksurv/datasets/data/bmt.arff +46 -0
  17. sksurv/datasets/data/breast_cancer_GSE7390-metastasis.arff +283 -0
  18. sksurv/datasets/data/cgvhd.arff +118 -0
  19. sksurv/datasets/data/flchain.arff +7887 -0
  20. sksurv/datasets/data/veteran.arff +148 -0
  21. sksurv/datasets/data/whas500.arff +520 -0
  22. sksurv/docstrings.py +99 -0
  23. sksurv/ensemble/__init__.py +2 -0
  24. sksurv/ensemble/_coxph_loss.cpython-310-x86_64-linux-gnu.so +0 -0
  25. sksurv/ensemble/boosting.py +1564 -0
  26. sksurv/ensemble/forest.py +902 -0
  27. sksurv/ensemble/survival_loss.py +151 -0
  28. sksurv/exceptions.py +18 -0
  29. sksurv/functions.py +114 -0
  30. sksurv/io/__init__.py +2 -0
  31. sksurv/io/arffread.py +89 -0
  32. sksurv/io/arffwrite.py +181 -0
  33. sksurv/kernels/__init__.py +1 -0
  34. sksurv/kernels/_clinical_kernel.cpython-310-x86_64-linux-gnu.so +0 -0
  35. sksurv/kernels/clinical.py +348 -0
  36. sksurv/linear_model/__init__.py +3 -0
  37. sksurv/linear_model/_coxnet.cpython-310-x86_64-linux-gnu.so +0 -0
  38. sksurv/linear_model/aft.py +208 -0
  39. sksurv/linear_model/coxnet.py +592 -0
  40. sksurv/linear_model/coxph.py +637 -0
  41. sksurv/meta/__init__.py +4 -0
  42. sksurv/meta/base.py +35 -0
  43. sksurv/meta/ensemble_selection.py +724 -0
  44. sksurv/meta/stacking.py +370 -0
  45. sksurv/metrics.py +1028 -0
  46. sksurv/nonparametric.py +911 -0
  47. sksurv/preprocessing.py +183 -0
  48. sksurv/svm/__init__.py +11 -0
  49. sksurv/svm/_minlip.cpython-310-x86_64-linux-gnu.so +0 -0
  50. sksurv/svm/_prsvm.cpython-310-x86_64-linux-gnu.so +0 -0
  51. sksurv/svm/minlip.py +690 -0
  52. sksurv/svm/naive_survival_svm.py +249 -0
  53. sksurv/svm/survival_svm.py +1236 -0
  54. sksurv/testing.py +108 -0
  55. sksurv/tree/__init__.py +1 -0
  56. sksurv/tree/_criterion.cpython-310-x86_64-linux-gnu.so +0 -0
  57. sksurv/tree/tree.py +790 -0
  58. sksurv/util.py +415 -0
sksurv/docstrings.py ADDED
@@ -0,0 +1,99 @@
1
+ # This program is free software: you can redistribute it and/or modify
2
+ # it under the terms of the GNU General Public License as published by
3
+ # the Free Software Foundation, either version 3 of the License, or
4
+ # (at your option) any later version.
5
+ #
6
+ # This program is distributed in the hope that it will be useful,
7
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
8
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
+ # GNU General Public License for more details.
10
+ #
11
+ # You should have received a copy of the GNU General Public License
12
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
13
+ _PRED_SURV_FN_EXAMPLE_DOC = """
14
+ .. plot::
15
+
16
+ >>> import matplotlib.pyplot as plt
17
+ >>> from sksurv.datasets import load_veterans_lung_cancer
18
+ >>> from sksurv.preprocessing import OneHotEncoder
19
+ >>> from sksurv.{estimator_mod} import {estimator_class}
20
+
21
+ Load the data and encode categorical features.
22
+
23
+ >>> X, y = load_veterans_lung_cancer()
24
+ >>> Xt = OneHotEncoder().fit_transform(X)
25
+
26
+ Fit the model.
27
+
28
+ >>> estimator = {estimator_class}().fit(Xt, y)
29
+
30
+ Estimate the survival function for the first 10 samples.
31
+
32
+ >>> surv_funcs = estimator.predict_survival_function(Xt.iloc[:10])
33
+
34
+ Plot the estimated survival functions.
35
+
36
+ >>> for fn in surv_funcs:
37
+ ... plt.step(fn.x, fn(fn.x), where="post")
38
+ ...
39
+ [...]
40
+ >>> plt.ylim(0, 1)
41
+ (0.0, 1.0)
42
+ >>> plt.show() # doctest: +SKIP
43
+ """
44
+
45
+ _PRED_CUMHAZ_FN_EXAMPLE_DOC = """
46
+ .. plot::
47
+
48
+ >>> import matplotlib.pyplot as plt
49
+ >>> from sksurv.datasets import load_veterans_lung_cancer
50
+ >>> from sksurv.preprocessing import OneHotEncoder
51
+ >>> from sksurv.{estimator_mod} import {estimator_class}
52
+
53
+ Load the data and encode categorical features.
54
+
55
+ >>> X, y = load_veterans_lung_cancer()
56
+ >>> Xt = OneHotEncoder().fit_transform(X)
57
+
58
+ Fit the model.
59
+
60
+ >>> estimator = {estimator_class}().fit(Xt, y)
61
+
62
+ Estimate the cumulative hazard function for the first 10 samples.
63
+
64
+ >>> chf_funcs = estimator.predict_cumulative_hazard_function(Xt.iloc[:10])
65
+
66
+ Plot the estimated cumulative hazard functions.
67
+
68
+ >>> for fn in chf_funcs:
69
+ ... plt.step(fn.x, fn(fn.x), where="post")
70
+ ...
71
+ [...]
72
+ >>> plt.show() # doctest: +SKIP
73
+ """
74
+
75
+
76
+ def append_survival_function_example(*, estimator_mod, estimator_class):
77
+ """Append example of using predict_survival_function to API doc"""
78
+
79
+ def func(f):
80
+ f.__doc__ += _PRED_SURV_FN_EXAMPLE_DOC.format(
81
+ estimator_mod=estimator_mod,
82
+ estimator_class=estimator_class,
83
+ )
84
+ return f
85
+
86
+ return func
87
+
88
+
89
+ def append_cumulative_hazard_example(*, estimator_mod, estimator_class):
90
+ """Append example of using predict_cumulative_hazard_function to API doc"""
91
+
92
+ def func(f):
93
+ f.__doc__ += _PRED_CUMHAZ_FN_EXAMPLE_DOC.format(
94
+ estimator_mod=estimator_mod,
95
+ estimator_class=estimator_class,
96
+ )
97
+ return f
98
+
99
+ return func
@@ -0,0 +1,2 @@
1
+ from .boosting import ComponentwiseGradientBoostingSurvivalAnalysis, GradientBoostingSurvivalAnalysis # noqa: F401
2
+ from .forest import ExtraSurvivalTrees, RandomSurvivalForest # noqa: F401