psifr.stats.percentile_rank#

psifr.stats.percentile_rank(actual, possible)#

Get percentile rank of a score compared to possible scores.

Parameters:
  • actual (float) – Score to be ranked. Generally a distance score.

  • possible (numpy.ndarray or list) – Possible scores to be compared to.

Returns:

rank – Rank scaled to range from 0 (low score) to 1 (high score).

Return type:

float

Examples

>>> from psifr import stats
>>> actual = 3
>>> possible = [1, 2, 2, 2, 3]
>>> stats.percentile_rank(actual, possible)
1.0