Как numpy.percentile вычисляет дробь для опции линейной интерполяции? - PullRequest
0 голосов
/ 18 января 2019

Я пытаюсь объяснить маркетологу, как работают процентили, но я понял, что не понимаю, как numpy.percentile вычисляет процентили с помощью метода линейной интерполяции. В частности, я не понимаю, как вычисляется дробь, поскольку документация довольно расплывчата, и моя попытка выполнить некоторые ручные вычисления не дала ожидаемых результатов:

Given a vector V of length N, the q-th percentile of V is the value q/100 of the way from the minimum to the maximum in a sorted copy of V. The values and distances of the two nearest neighbors as well as the interpolation parameter will determine the percentile if the normalized ranking does not match the location of q exactly. This function is the same as the median if q=50, the same as the minimum if q=0 and the same as the maximum if q=100.

‘linear’: i + (j - i) * fraction, where fraction is the fractional part of the index surrounded by i and j.

Кроме того, что подразумевается под нормированным рейтингом?

...