chemicalchecker.tool.targetmate.nonconformist.nc.ClassifierNc

class ClassifierNc(model, err_func=<chemicalchecker.tool.targetmate.nonconformist.nc.MarginErrFunc object>, normalizer=None, beta=0)[source]

Bases: BaseModelNc

Nonconformity scorer using an underlying class probability estimating model.

Parameters

modelClassifierAdapter

Underlying classification model used for calculating nonconformity scores.

err_funcClassificationErrFunc

Error function object.

normalizerBaseScorer

Normalization model.

betafloat

Normalization smoothing parameter. As the beta-value increases, the normalized nonconformity function approaches a non-normalized equivalent.

Attributes

modelClassifierAdapter

Underlying model object.

err_funcClassificationErrFunc

Scorer function used to calculate nonconformity scores.

See also

RegressorNc, NormalizedRegressorNc

Methods

fit

Fits the underlying model of the nonconformity scorer.

get_params

Get parameters for this estimator.

score

Calculates the nonconformity score of a set of samples.

set_params

Set the parameters of this estimator.

fit(x, y)

Fits the underlying model of the nonconformity scorer.

Parameters

xnumpy array of shape [n_samples, n_features]

Inputs of examples for fitting the underlying model.

ynumpy array of shape [n_samples]

Outputs of examples for fitting the underlying model.

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.

score(x, y=None)

Calculates the nonconformity score of a set of samples.

Parameters

xnumpy array of shape [n_samples, n_features]

Inputs of examples for which to calculate a nonconformity score.

ynumpy array of shape [n_samples]

Outputs of examples for which to calculate a nonconformity score.

Returns

ncnumpy array of shape [n_samples]

Nonconformity scores of 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

**paramsdict

Estimator parameters.

Returns

selfestimator instance

Estimator instance.