scikit-survival 0.26.0__cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_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.
- scikit_survival-0.26.0.dist-info/METADATA +185 -0
- scikit_survival-0.26.0.dist-info/RECORD +58 -0
- scikit_survival-0.26.0.dist-info/WHEEL +6 -0
- scikit_survival-0.26.0.dist-info/licenses/COPYING +674 -0
- scikit_survival-0.26.0.dist-info/top_level.txt +1 -0
- sksurv/__init__.py +183 -0
- sksurv/base.py +115 -0
- sksurv/bintrees/__init__.py +15 -0
- sksurv/bintrees/_binarytrees.cpython-312-x86_64-linux-gnu.so +0 -0
- sksurv/column.py +204 -0
- sksurv/compare.py +123 -0
- sksurv/datasets/__init__.py +12 -0
- sksurv/datasets/base.py +614 -0
- sksurv/datasets/data/GBSG2.arff +700 -0
- sksurv/datasets/data/actg320.arff +1169 -0
- sksurv/datasets/data/bmt.arff +46 -0
- sksurv/datasets/data/breast_cancer_GSE7390-metastasis.arff +283 -0
- sksurv/datasets/data/cgvhd.arff +118 -0
- sksurv/datasets/data/flchain.arff +7887 -0
- sksurv/datasets/data/veteran.arff +148 -0
- sksurv/datasets/data/whas500.arff +520 -0
- sksurv/docstrings.py +99 -0
- sksurv/ensemble/__init__.py +2 -0
- sksurv/ensemble/_coxph_loss.cpython-312-x86_64-linux-gnu.so +0 -0
- sksurv/ensemble/boosting.py +1564 -0
- sksurv/ensemble/forest.py +902 -0
- sksurv/ensemble/survival_loss.py +151 -0
- sksurv/exceptions.py +18 -0
- sksurv/functions.py +114 -0
- sksurv/io/__init__.py +2 -0
- sksurv/io/arffread.py +91 -0
- sksurv/io/arffwrite.py +181 -0
- sksurv/kernels/__init__.py +1 -0
- sksurv/kernels/_clinical_kernel.cpython-312-x86_64-linux-gnu.so +0 -0
- sksurv/kernels/clinical.py +348 -0
- sksurv/linear_model/__init__.py +3 -0
- sksurv/linear_model/_coxnet.cpython-312-x86_64-linux-gnu.so +0 -0
- sksurv/linear_model/aft.py +208 -0
- sksurv/linear_model/coxnet.py +592 -0
- sksurv/linear_model/coxph.py +637 -0
- sksurv/meta/__init__.py +4 -0
- sksurv/meta/base.py +35 -0
- sksurv/meta/ensemble_selection.py +724 -0
- sksurv/meta/stacking.py +370 -0
- sksurv/metrics.py +1028 -0
- sksurv/nonparametric.py +911 -0
- sksurv/preprocessing.py +195 -0
- sksurv/svm/__init__.py +11 -0
- sksurv/svm/_minlip.cpython-312-x86_64-linux-gnu.so +0 -0
- sksurv/svm/_prsvm.cpython-312-x86_64-linux-gnu.so +0 -0
- sksurv/svm/minlip.py +695 -0
- sksurv/svm/naive_survival_svm.py +249 -0
- sksurv/svm/survival_svm.py +1236 -0
- sksurv/testing.py +155 -0
- sksurv/tree/__init__.py +1 -0
- sksurv/tree/_criterion.cpython-312-x86_64-linux-gnu.so +0 -0
- sksurv/tree/tree.py +790 -0
- sksurv/util.py +416 -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
|
|
Binary file
|