Borda Count

mlpy.borda_count(x, k=None)

Given N ranked ids lists of length P compute the number of extractions on top-k positions and the mean position for each id. Sort the element ids with decreasing number of extractions, and element ids with equal number of extractions will be sorted with increasing mean positions.

Parameters :
x : 2d array_like object integer (N, P)

ranked ids lists. For each list ids must be unique in [0, P-1].

k : None or integer

compute borda on top-k position (None -> k = P)

Returns :
borda : 1d numpy array objects

sorted-ids, number of extractions, mean positions

Example:

>>> import numpy as np
>>> import mlpy
>>> x = [[2,4,1,3,0], # first ranked list
...      [3,4,1,2,0], # second ranked list
...      [2,4,3,0,1], # third ranked list
...      [0,1,4,2,3]] # fourth ranked list
>>> mlpy.borda_count(x=x, k=3)
(array([4, 1, 2, 3, 0]), array([4, 3, 2, 2, 1]), array([ 1.25      ,  1.66666667,  0.        ,  1.        ,  0.        ]))
  • Id 4 is in the first position with 4 extractions and mean position 1.25.
  • Id 1 is in the first position with 3 extractions and mean position 1.67.
  • ...

Previous topic

Canberra Distances and Stability Indicator of Ranked Lists

Next topic

Find Peaks

This Page