mapie.metrics
.regression_coverage_score_v2¶
- mapie.metrics.regression_coverage_score_v2(y_true: ndarray[Any, dtype[_ScalarType_co]], y_intervals: ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]] [source]¶
Effective coverage score obtained by the prediction intervals.
The effective coverage is obtained by estimating the fraction of true labels that lie within the prediction intervals.
It is different from
regression_coverage_score
because it uses directly the output ofpredict
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_intervals: NDArray of shape (n_samples, 2, n_alpha)
Lower and upper bound of prediction intervals with different alpha risks.
- Returns
- NDArray of shape (n_alpha,)
Effective coverage obtained by the prediction intervals.