sksurv.metrics.as_concordance_index_ipcw_scorer#

class sksurv.metrics.as_concordance_index_ipcw_scorer(estimator, tau=None, tied_tol=1e-08)[source]#

Wraps an estimator to use concordance_index_ipcw() as score function.

See the User Guide for using it for hyper-parameter optimization.

Parameters:
  • estimator (object) – Instance of an estimator.

  • tau (float, optional) – Truncation time. The survival function for the underlying censoring time distribution \(D\) needs to be positive at tau, i.e., tau should be chosen such that the probability of being censored after time tau is non-zero: \(P(D > \tau) > 0\). If None, no truncation is performed.

  • tied_tol (float, optional, default: 1e-8) – The tolerance value for considering ties. If the absolute difference between risk scores is smaller or equal than tied_tol, risk scores are considered tied.

estimator_#

Estimator that was fit.

Type:

estimator

__init__(estimator, tau=None, tied_tol=1e-08)[source]#

Methods

__init__(estimator[, tau, tied_tol])

fit(X, y, **fit_params)

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

predict(X)

Call predict on the estimator.

predict_cumulative_hazard_function(X)

Call predict_cumulative_hazard_function on the estimator.

predict_survival_function(X)

Call predict_survival_function on the estimator.

score(X, y)

Returns the score on the given data.

set_params(**params)

Set the parameters of this estimator.

get_metadata_routing()#

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:

routing – A MetadataRequest encapsulating routing information.

Return type:

MetadataRequest

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(X)#

Call predict on the estimator.

Only available if estimator supports predict.

Parameters:

X (indexable, length n_samples) – Must fulfill the input assumptions of the underlying estimator.

predict_cumulative_hazard_function(X)#

Call predict_cumulative_hazard_function on the estimator.

Only available if estimator supports predict_cumulative_hazard_function.

Parameters:

X (indexable, length n_samples) – Must fulfill the input assumptions of the underlying estimator.

predict_survival_function(X)#

Call predict_survival_function on the estimator.

Only available if estimator supports predict_survival_function.

Parameters:

X (indexable, length n_samples) – Must fulfill the input assumptions of the underlying estimator.

score(X, y)[source]#

Returns the score on the given data.

Parameters:
  • X (array-like of shape (n_samples, n_features)) – Input data, where n_samples is the number of samples and n_features is the number of features.

  • y (array-like of shape (n_samples,)) – Target relative to X for classification or regression; None for unsupervised learning.

Returns:

score

Return type:

float

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