netcal.binning.IsotonicRegression

class netcal.binning.IsotonicRegression(detection: bool = False, independent_probabilities: bool = False)

Isotonic Regression method. This method has initially been proposed by [1]. This method is similar to HistogramBinning but with dynamic bin sizes and boundaries. A piecewise constant function gets fit to ground truth labels sorted by given confidence estimates.

Parameters:
  • detection (bool, default: False) – If False, the input array ‘X’ is treated as multi-class confidence input (softmax) with shape (n_samples, [n_classes]). If True, the input array ‘X’ is treated as a box predictions with several box features (at least box confidence must be present) with shape (n_samples, [n_box_features]).

  • independent_probabilities (bool, optional, default: False) – Boolean for multi class probabilities. If set to True, the probability estimates for each class are treated as independent of each other (sigmoid).

References

Methods

__init__([detection, independent_probabilities])

Create an instance of IsotonicRegression.

clear()

Clear model parameters.

epsilon(dtype)

Get the smallest digit that is representable depending on the passed dtype (NumPy or PyTorch).

fit(X, y)

Build Isotonic Regression model.

fit_transform(X[, y])

Fit to data, then transform it.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

load_model(filename)

Load model from saved torch dump.

save_model(filename)

Save model instance as with torch's save function as this is safer for torch tensors.

set_output(*[, transform])

Set output container.

set_params(**params)

Set the parameters of this estimator.

transform(X)

After model calibration, this function is used to get calibrated outputs of uncalibrated confidence estimates.