alibi_detect.utils.misc module
- alibi_detect.utils.misc.quantile(sample, p, type=7, sorted=False, interpolate=True)[source]
Estimate a desired quantile of a univariate distribution from a vector of samples
- Parameters:
sample (
ndarray
) – A 1D vector of valuesp (
float
) – The desired quantile in (0,1)type (
int
) – The method for computing the quantile. See https://wikipedia.org/wiki/Quantile#Estimating_quantiles_from_a_samplesorted (
bool
) – Whether or not the vector is already sorted into ascending orderinterpolate (
bool
) – Whether to interpolate the desired quantile.
- Return type:
- Returns:
An estimate of the quantile