pitcp.utils.coverage_gap¶
- coverage_gap(labels, covered)[source]¶
Computes the range of empirical coverage across labeled groups.
- Parameters:
labels (np.typing.ArrayLike) – Group labels with shape
(n_samples,).covered (np.typing.ArrayLike) – Boolean mask with shape
(n_samples,)or(n_samples, n_levels).
- Returns:
- Maximum minus minimum group coverage. A scalar is returned
for one coverage mask and an array for multiple masks.
- Return type:
float | np.ndarray
- Raises:
ValueError – If inputs are empty, have invalid dimensions, or contain different sample counts.