scikit-survival 0.24.1__cp311-cp311-win_amd64.whl → 0.25.0__cp311-cp311-win_amd64.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.25.0.dist-info/METADATA +185 -0
- scikit_survival-0.25.0.dist-info/RECORD +58 -0
- {scikit_survival-0.24.1.dist-info → scikit_survival-0.25.0.dist-info}/WHEEL +1 -1
- sksurv/__init__.py +51 -6
- sksurv/base.py +12 -2
- sksurv/bintrees/_binarytrees.cp311-win_amd64.pyd +0 -0
- sksurv/column.py +33 -29
- sksurv/compare.py +22 -22
- sksurv/datasets/base.py +45 -20
- sksurv/docstrings.py +99 -0
- sksurv/ensemble/_coxph_loss.cp311-win_amd64.pyd +0 -0
- sksurv/ensemble/boosting.py +116 -168
- sksurv/ensemble/forest.py +94 -151
- sksurv/functions.py +29 -29
- sksurv/io/arffread.py +34 -3
- sksurv/io/arffwrite.py +38 -2
- sksurv/kernels/_clinical_kernel.cp311-win_amd64.pyd +0 -0
- sksurv/kernels/clinical.py +33 -13
- sksurv/linear_model/_coxnet.cp311-win_amd64.pyd +0 -0
- sksurv/linear_model/aft.py +14 -11
- sksurv/linear_model/coxnet.py +138 -89
- sksurv/linear_model/coxph.py +102 -83
- sksurv/meta/ensemble_selection.py +91 -9
- sksurv/meta/stacking.py +47 -26
- sksurv/metrics.py +257 -224
- sksurv/nonparametric.py +150 -81
- sksurv/preprocessing.py +55 -27
- sksurv/svm/_minlip.cp311-win_amd64.pyd +0 -0
- sksurv/svm/_prsvm.cp311-win_amd64.pyd +0 -0
- sksurv/svm/minlip.py +160 -79
- sksurv/svm/naive_survival_svm.py +63 -34
- sksurv/svm/survival_svm.py +103 -103
- sksurv/tree/_criterion.cp311-win_amd64.pyd +0 -0
- sksurv/tree/tree.py +170 -84
- sksurv/util.py +80 -26
- scikit_survival-0.24.1.dist-info/METADATA +0 -889
- scikit_survival-0.24.1.dist-info/RECORD +0 -57
- {scikit_survival-0.24.1.dist-info → scikit_survival-0.25.0.dist-info}/licenses/COPYING +0 -0
- {scikit_survival-0.24.1.dist-info → scikit_survival-0.25.0.dist-info}/top_level.txt +0 -0
sksurv/meta/stacking.py
CHANGED
|
@@ -67,11 +67,11 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
67
67
|
n_features_in_ : int
|
|
68
68
|
Number of features seen during ``fit``.
|
|
69
69
|
|
|
70
|
-
feature_names_in_ : ndarray
|
|
70
|
+
feature_names_in_ : ndarray, shape = (`n_features_in_`,)
|
|
71
71
|
Names of features seen during ``fit``. Defined only when `X`
|
|
72
72
|
has feature names that are all strings.
|
|
73
73
|
|
|
74
|
-
unique_times_ :
|
|
74
|
+
unique_times_ : ndarray, shape = (n_unique_times,)
|
|
75
75
|
Unique time points.
|
|
76
76
|
"""
|
|
77
77
|
|
|
@@ -199,6 +199,7 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
199
199
|
return Xt
|
|
200
200
|
|
|
201
201
|
def __len__(self):
|
|
202
|
+
"""Return the number of base estimators."""
|
|
202
203
|
return len(self.base_estimators)
|
|
203
204
|
|
|
204
205
|
def fit(self, X, y=None, **fit_params):
|
|
@@ -209,9 +210,12 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
209
210
|
X : array-like, shape = (n_samples, n_features)
|
|
210
211
|
Training data.
|
|
211
212
|
|
|
212
|
-
y : array-like, optional
|
|
213
|
+
y : array-like, shape = (n_samples,), optional
|
|
213
214
|
Target data if base estimators are supervised.
|
|
214
215
|
|
|
216
|
+
**fit_params : dict
|
|
217
|
+
Parameters passed to the ``fit`` method of each base estimator.
|
|
218
|
+
|
|
215
219
|
Returns
|
|
216
220
|
-------
|
|
217
221
|
self
|
|
@@ -228,7 +232,7 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
228
232
|
def predict(self, X):
|
|
229
233
|
"""Perform prediction.
|
|
230
234
|
|
|
231
|
-
Only available
|
|
235
|
+
Only available if the meta estimator has a ``predict`` method.
|
|
232
236
|
|
|
233
237
|
Parameters
|
|
234
238
|
----------
|
|
@@ -237,10 +241,10 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
237
241
|
|
|
238
242
|
Returns
|
|
239
243
|
-------
|
|
240
|
-
prediction :
|
|
244
|
+
prediction : ndarray, shape = (n_samples, n_dim)
|
|
241
245
|
Prediction of meta estimator that combines
|
|
242
246
|
predictions of base estimators. `n_dim` depends
|
|
243
|
-
on the return value of meta estimator's
|
|
247
|
+
on the return value of meta estimator's ``predict``
|
|
244
248
|
method.
|
|
245
249
|
"""
|
|
246
250
|
Xt = self._predict_estimators(X)
|
|
@@ -250,7 +254,7 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
250
254
|
def predict_proba(self, X):
|
|
251
255
|
"""Perform prediction.
|
|
252
256
|
|
|
253
|
-
Only available if the meta estimator has a predict_proba method.
|
|
257
|
+
Only available if the meta estimator has a ``predict_proba`` method.
|
|
254
258
|
|
|
255
259
|
Parameters
|
|
256
260
|
----------
|
|
@@ -272,7 +276,7 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
272
276
|
def predict_log_proba(self, X):
|
|
273
277
|
"""Perform prediction.
|
|
274
278
|
|
|
275
|
-
Only available if the meta estimator has a predict_log_proba method.
|
|
279
|
+
Only available if the meta estimator has a ``predict_log_proba`` method.
|
|
276
280
|
|
|
277
281
|
Parameters
|
|
278
282
|
----------
|
|
@@ -298,24 +302,33 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
298
302
|
def predict_cumulative_hazard_function(self, X, return_array=False):
|
|
299
303
|
"""Perform prediction.
|
|
300
304
|
|
|
301
|
-
Only available if the meta estimator has a predict_cumulative_hazard_function method.
|
|
305
|
+
Only available if the meta estimator has a ``predict_cumulative_hazard_function`` method.
|
|
302
306
|
|
|
303
307
|
Parameters
|
|
304
308
|
----------
|
|
305
309
|
X : array-like, shape = (n_samples, n_features)
|
|
306
310
|
Data with samples to predict.
|
|
307
311
|
|
|
308
|
-
return_array :
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
+
return_array : bool, default: False
|
|
313
|
+
Whether to return a single array of cumulative hazard values
|
|
314
|
+
or a list of step functions.
|
|
315
|
+
|
|
316
|
+
If `False`, a list of :class:`sksurv.functions.StepFunction`
|
|
317
|
+
objects is returned.
|
|
318
|
+
|
|
319
|
+
If `True`, a 2d-array of shape `(n_samples, n_unique_times)` is
|
|
320
|
+
returned, where `n_unique_times` is the number of unique
|
|
321
|
+
event times in the training data. Each row represents the cumulative
|
|
322
|
+
hazard function of an individual evaluated at `unique_times_`.
|
|
312
323
|
|
|
313
324
|
Returns
|
|
314
325
|
-------
|
|
315
326
|
cum_hazard : ndarray
|
|
316
|
-
If `return_array` is
|
|
317
|
-
|
|
318
|
-
|
|
327
|
+
If `return_array` is `False`, an array of `n_samples`
|
|
328
|
+
:class:`sksurv.functions.StepFunction` instances is returned.
|
|
329
|
+
|
|
330
|
+
If `return_array` is `True`, a numeric array of shape
|
|
331
|
+
`(n_samples, n_unique_times_)` is returned.
|
|
319
332
|
"""
|
|
320
333
|
Xt = self._predict_estimators(X)
|
|
321
334
|
return self.final_estimator_.predict_cumulative_hazard_function(Xt, return_array)
|
|
@@ -324,25 +337,33 @@ class Stacking(MetaEstimatorMixin, SurvivalAnalysisMixin, _BaseComposition):
|
|
|
324
337
|
def predict_survival_function(self, X, return_array=False):
|
|
325
338
|
"""Perform prediction.
|
|
326
339
|
|
|
327
|
-
Only available if the meta estimator has a predict_survival_function method.
|
|
340
|
+
Only available if the meta estimator has a ``predict_survival_function`` method.
|
|
328
341
|
|
|
329
342
|
Parameters
|
|
330
343
|
----------
|
|
331
344
|
X : array-like, shape = (n_samples, n_features)
|
|
332
345
|
Data with samples to predict.
|
|
333
346
|
|
|
347
|
+
return_array : bool, default: False
|
|
348
|
+
Whether to return a single array of survival probabilities
|
|
349
|
+
or a list of step functions.
|
|
350
|
+
|
|
351
|
+
If `False`, a list of :class:`sksurv.functions.StepFunction`
|
|
352
|
+
objects is returned.
|
|
353
|
+
|
|
354
|
+
If `True`, a 2d-array of shape `(n_samples, n_unique_times)` is
|
|
355
|
+
returned, where `n_unique_times` is the number of unique
|
|
356
|
+
event times in the training data. Each row represents the survival
|
|
357
|
+
function of an individual evaluated at `unique_times_`.
|
|
358
|
+
|
|
334
359
|
Returns
|
|
335
360
|
-------
|
|
336
361
|
survival : ndarray
|
|
337
|
-
If `return_array` is
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return_array : boolean, default: False
|
|
343
|
-
If set, return an array with the probability
|
|
344
|
-
of survival for each `self.unique_times_`,
|
|
345
|
-
otherwise an array of :class:`sksurv.functions.StepFunction`.
|
|
362
|
+
If `return_array` is `False`, an array of `n_samples`
|
|
363
|
+
:class:`sksurv.functions.StepFunction` instances is returned.
|
|
364
|
+
|
|
365
|
+
If `return_array` is `True`, a numeric array of shape
|
|
366
|
+
`(n_samples, n_unique_times_)` is returned.
|
|
346
367
|
|
|
347
368
|
"""
|
|
348
369
|
Xt = self._predict_estimators(X)
|