netcal.AbstractCalibration¶
- class netcal.AbstractCalibration(detection: bool = False, independent_probabilities: bool = False)¶
Abstract base class for all calibration methods. Inherits functions from sklearn’s BaseEstimator.
- 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).
- epsilon¶
Lowest possible digit that can be computed. Needed for several operations like divisions or log to guarantee values inequal to 0 or 1.
- Type:
float
Methods
__init__
([detection, independent_probabilities])Create an instance of AbstractCalibration.
clear
()Clear model parameters.
epsilon
(dtype)Get the smallest digit that is representable depending on the passed dtype (NumPy or PyTorch).
fit
(X, y)Abstract function call to build the calibration 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)Abstract function.