scikit-survival 0.24.0__cp310-cp310-macosx_11_0_arm64.whl → 0.25.0__cp310-cp310-macosx_11_0_arm64.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 (39) 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.24.0.dist-info → scikit_survival-0.25.0.dist-info}/WHEEL +2 -1
  4. sksurv/__init__.py +51 -6
  5. sksurv/base.py +12 -2
  6. sksurv/bintrees/_binarytrees.cpython-310-darwin.so +0 -0
  7. sksurv/column.py +33 -29
  8. sksurv/compare.py +22 -22
  9. sksurv/datasets/base.py +45 -20
  10. sksurv/docstrings.py +99 -0
  11. sksurv/ensemble/_coxph_loss.cpython-310-darwin.so +0 -0
  12. sksurv/ensemble/boosting.py +116 -168
  13. sksurv/ensemble/forest.py +94 -151
  14. sksurv/functions.py +29 -29
  15. sksurv/io/arffread.py +34 -3
  16. sksurv/io/arffwrite.py +38 -2
  17. sksurv/kernels/_clinical_kernel.cpython-310-darwin.so +0 -0
  18. sksurv/kernels/clinical.py +33 -13
  19. sksurv/linear_model/_coxnet.cpython-310-darwin.so +0 -0
  20. sksurv/linear_model/aft.py +14 -11
  21. sksurv/linear_model/coxnet.py +138 -89
  22. sksurv/linear_model/coxph.py +102 -83
  23. sksurv/meta/ensemble_selection.py +91 -9
  24. sksurv/meta/stacking.py +47 -26
  25. sksurv/metrics.py +257 -224
  26. sksurv/nonparametric.py +150 -81
  27. sksurv/preprocessing.py +55 -27
  28. sksurv/svm/_minlip.cpython-310-darwin.so +0 -0
  29. sksurv/svm/_prsvm.cpython-310-darwin.so +0 -0
  30. sksurv/svm/minlip.py +160 -79
  31. sksurv/svm/naive_survival_svm.py +63 -34
  32. sksurv/svm/survival_svm.py +104 -104
  33. sksurv/tree/_criterion.cpython-310-darwin.so +0 -0
  34. sksurv/tree/tree.py +170 -84
  35. sksurv/util.py +80 -26
  36. scikit_survival-0.24.0.dist-info/METADATA +0 -888
  37. scikit_survival-0.24.0.dist-info/RECORD +0 -57
  38. {scikit_survival-0.24.0.dist-info → scikit_survival-0.25.0.dist-info/licenses}/COPYING +0 -0
  39. {scikit_survival-0.24.0.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 of shape (`n_features_in_`,)
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_ : array of shape = (n_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 of the meta estimator has a predict method.
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 : array, shape = (n_samples, n_dim)
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 `predict`
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 : boolean, default: False
309
- If set, return an array with the cumulative hazard rate
310
- for each `self.unique_times_`, otherwise an array of
311
- :class:`sksurv.functions.StepFunction`.
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 set, an array with the cumulative hazard rate
317
- for each `self.unique_times_`, otherwise an array of length `n_samples`
318
- of :class:`sksurv.functions.StepFunction` instances will be returned.
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 set, an array with the probability of
338
- survival for each `self.unique_times_`, otherwise an array of
339
- length `n_samples` of :class:`sksurv.functions.StepFunction`
340
- instances will be returned.
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)