probly.conformal_prediction.utils.quantile

Quantile calculation utility for conformal prediction.

Functions

calculate_quantile(scores, alpha)

Calculate the quantile for conformal prediction.

calculate_weighted_quantile(values, quantile)

Calculates a weighted quantile of the values using numpy.

probly.conformal_prediction.utils.quantile.calculate_quantile(scores, alpha)[source]

Calculate the quantile for conformal prediction.

Parameters: scores : np.ndarray

Non-conformity scores

alphafloat

Significance level (target coverage is 1-alpha)

Returns: float (The (1-alpha)-quantile of the scores)

Parameters:
Return type:

float

probly.conformal_prediction.utils.quantile.calculate_weighted_quantile(values, quantile, sample_weight=None)[source]

Calculates a weighted quantile of the values using numpy.

Parameters:
Return type:

float