bluecast.conformal_prediction.effectiveness_nonconformity_measures

Module Contents

Functions

convert_expected_effectiveness_nonconformity_input_types(...)

one_c(y_hat)

Calculate proportion of singleton sets among all prediction sets.

avg_c(→ float)

Calculate the average number of labels in all prediction sets.

prediction_interval_spans(→ Dict[float, float])

Calculate the mean span or width prediction intervals.

bluecast.conformal_prediction.effectiveness_nonconformity_measures.convert_expected_effectiveness_nonconformity_input_types(y_hat: numpy.ndarray | pandas.Series | pandas.DataFrame) numpy.ndarray
bluecast.conformal_prediction.effectiveness_nonconformity_measures.one_c(y_hat: numpy.ndarray | pandas.DataFrame | pandas.Series)

Calculate proportion of singleton sets among all prediction sets. :param y_hat: Predicted probabilities of shape (n_samples, 1) where each row is a set of classes.

bluecast.conformal_prediction.effectiveness_nonconformity_measures.avg_c(y_hat: numpy.ndarray | pandas.DataFrame | pandas.Series) float

Calculate the average number of labels in all prediction sets. :param y_hat: Predicted probabilities of shape (n_samples, 1) where each row is a set of classes.

bluecast.conformal_prediction.effectiveness_nonconformity_measures.prediction_interval_spans(prediction_intervals: pandas.DataFrame, alphas) Dict[float, float]

Calculate the mean span or width prediction intervals.

This checks the distance between low and high band for each alpha. :param prediction_intervals: Predicted bands according to provided confidence levels. :param alphas: List of alphas indicating which confidence levels to check