chemicalchecker.tool.targetmate.nonconformist.icp.BaseIcp

class BaseIcp(nc_function, condition=None)[source]

Bases: BaseEstimator

Base class for inductive conformal predictors.

Methods

calibrate

Calibrate conformal predictor based on underlying nonconformity scorer.

fit

Fit underlying nonconformity scorer.

get_params

Get parameters for this estimator.

set_params

Set the parameters of this estimator.

calibrate(x, y, increment=False)[source]

Calibrate conformal predictor based on underlying nonconformity scorer.

Parameters

xnumpy array of shape [n_samples, n_features]

Inputs of examples for calibrating the conformal predictor.

ynumpy array of shape [n_samples, n_features]

Outputs of examples for calibrating the conformal predictor.

incrementboolean

If True, performs an incremental recalibration of the conformal predictor. The supplied x and y are added to the set of previously existing calibration examples, and the conformal predictor is then calibrated on both the old and new calibration examples.

Returns

None

fit(x, y)[source]

Fit underlying nonconformity scorer.

Parameters

xnumpy array of shape [n_samples, n_features]

Inputs of examples for fitting the nonconformity scorer.

ynumpy array of shape [n_samples]

Outputs of examples for fitting the nonconformity scorer.

Returns

None

get_params(deep=True)

Get parameters for this estimator.

Parameters

deepbool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns

paramsdict

Parameter names mapped to their values.

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

**paramsdict

Estimator parameters.

Returns

selfestimator instance

Estimator instance.