climb.tool.impl.data_suite.third_party.uq360.algorithms.classification_calibration package

Submodules

climb.tool.impl.data_suite.third_party.uq360.algorithms.classification_calibration.classification_calibration module

class climb.tool.impl.data_suite.third_party.uq360.algorithms.classification_calibration.classification_calibration.ClassificationCalibration(num_classes, fit_mode='features', method='isotonic', base_model_prediction_func=None)[source]

Bases: PostHocUQ

Post hoc calibration of classification models. Currently wraps CalibratedClassifierCV from sklearn and allows non-sklearn models to be calibrated.

fit(X, y)[source]

Fits calibration model using the provided calibration set.

Parameters:
  • X – array-like of shape (n_samples, n_features) or (n_samples, n_classes). Features vectors of the training data or the probability scores from the base model.

  • y – array-like of shape (n_samples,) or (n_samples, n_targets) Target values

Returns:

self

get_params(deep=True)[source]

This method should not take any arguments and returns a dict of the __init__ parameters.

predict(X)[source]

Obtain calibrated predictions for the test points.

Parameters:

X – array-like of shape (n_samples, n_features) or (n_samples, n_classes). Features vectors of the training data or the probability scores from the base model.

Returns:

A namedtupe that holds

y_pred: ndarray of shape (n_samples,)

Predicted labels of the test points.

y_prob: ndarray of shape (n_samples, n_classes)

Predicted probability scores of the classes.

Return type:

namedtuple

Module contents