Implementation of Rank-Biased Overlap in JavaScript
npm install rbo#### RBO: Object Constructor holding the RBO-state calculation:
``javascript`
@constructor
@param {number} p - degree (0..1) of top-weightedness of the RBO metricvar rbo = new RBO(0.8);
Example:
#### RBO.calculate: Calculates similarity RBO:
`javascript`
@function
@param {Array} s - sorted ranked list
@param {Array} t - sorted ranked list
@return {number} similarity RBO scores achievedrbo.calculate(['a', 'b', 'c', 'd', 'e'],['b', 'a', 'g', 'h', 'e', 'k', 'l', 'c']);
Example:
#### RBO.calcWeight: Calculates the weight of first d rankings with parameter p
`javascript`
@function calcWeight
@static
@param {number} p - degree (0..1) of top-weightedness of the RBO metric
@param {number} d - rankingRBO.calcWeight(0.9, 10);
Example:helps inform the choice of the parameter p`
Free to use and abuse under the MIT license.
http://www.opensource.org/licenses/mit-license.php