# sksurv.nonparametric.CensoringDistributionEstimator#

class sksurv.nonparametric.CensoringDistributionEstimator[source]#

Kaplan–Meier estimator for the censoring distribution.

__init__()[source]#

Methods

 Estimate censoring distribution from training data. get_params([deep]) Get parameters for this estimator. Return inverse probability of censoring weights at given time points. predict_proba(time) Return probability of an event after given time point. set_params(**params) Set the parameters of this estimator.
fit(y)[source]#

Estimate censoring distribution from training data.

Parameters

y (structured array, shape = (n_samples,)) – A structured array containing the binary event indicator as first field, and time of event or time of censoring as second field.

Return type

self

get_params(deep=True)#

Get parameters for this estimator.

Parameters

deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns

params – Parameter names mapped to their values.

Return type

dict

predict_ipcw(y)[source]#

Return inverse probability of censoring weights at given time points.

$$\omega_i = \delta_i / \hat{G}(y_i)$$

Parameters

y (structured array, shape = (n_samples,)) – A structured array containing the binary event indicator as first field, and time of event or time of censoring as second field.

Returns

ipcw – Inverse probability of censoring weights.

Return type

array, shape = (n_samples,)

predict_proba(time)[source]#

Return probability of an event after given time point.

$$\hat{S}(t) = P(T > t)$$

Parameters

time (array, shape = (n_samples,)) – Time to estimate probability at.

Returns

prob – Probability of an event.

Return type

array, shape = (n_samples,)

set_params(**params)#

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters

**params (dict) – Estimator parameters.

Returns

self – Estimator instance.

Return type

estimator instance