nonconformist.nc.RegressionErrFunc

class nonconformist.nc.RegressionErrFunc

Base class for regression model error functions.

__init__()
apply(prediction, y)

Apply the nonconformity function.

Parameters:

prediction : numpy array of shape [n_samples, n_classes]

Class probability estimates for each sample.

y : numpy array of shape [n_samples]

True output labels of each sample.

Returns:

nc : numpy array of shape [n_samples]

Nonconformity scores of the samples.

apply_inverse(nc, significance)

Apply the inverse of the nonconformity function (i.e., calculate prediction interval).

Parameters:

nc : numpy array of shape [n_calibration_samples]

Nonconformity scores obtained for conformal predictor.

significance : float

Significance level (0, 1).

Returns:

interval : numpy array of shape [n_samples, 2]

Minimum and maximum interval boundaries for each prediction.