mapie.metrics.regression_coverage_score_v2

mapie.metrics.regression_coverage_score_v2(y_true: numpy.ndarray[Any, numpy.dtype[numpy._typing._array_like._ScalarType_co]], y_intervals: numpy.ndarray[Any, numpy.dtype[numpy._typing._array_like._ScalarType_co]]) numpy.ndarray[Any, numpy.dtype[numpy._typing._array_like._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 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_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.

Examples using mapie.metrics.regression_coverage_score_v2