incerto.conformal.compute_quantile

incerto.conformal.compute_quantile#

incerto.conformal.compute_quantile(scores, alpha, adjusted=True)[source]#

Compute the conformal quantile at level (1 - alpha).

Uses exact order-statistic indexing (ceil-quantile) rather than interpolation, which is required for the finite-sample coverage guarantee to hold.

Parameters:
  • scores (Tensor) – Conformity scores from calibration set.

  • alpha (float) – Desired miscoverage rate.

  • adjusted (bool) – If True, uses the finite-sample correction ⌈(1-α)(n+1)⌉.

Return type:

float

Returns:

Quantile threshold.