alibi_detect.utils.pytorch.misc module
- alibi_detect.utils.pytorch.misc.quantile(sample, p, type=7, sorted=False)[source]
Estimate a desired quantile of a univariate distribution from a vector of samples
- Parameters
sample (
Tensor
) – 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 order
- Return type
- Returns
An estimate of the quantile