mapie.metrics.classification_coverage_score_v2

mapie.metrics.classification_coverage_score_v2(y_true: ndarray[Any, dtype[_ScalarType_co]], y_pred_set: ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]][source]

Effective coverage score obtained by the prediction sets.

The effective coverage is obtained by estimating the fraction of true labels that lie within the prediction sets.

It is different from classification_coverage_score because it uses directly the output of predict method and can compute the coverage for each alpha.

Parameters
y_true: NDArray of shape (n_samples, n_alpha) or (n_samples,)

True labels.

y_pred_set: NDArray of shape (n_samples, n_class, n_alpha)

Prediction sets given by booleans of labels.

Returns
NDArray of shape (n_alpha,)

Effective coverage obtained by the prediction sets.