Giter Club home page Giter Club logo

js-rbo's Introduction

RBO - Rank-Biased Overlap

Measures the overlap between the two lists at each position, while introducing a bias based on the rank so that a difference further in the lists is less important than at the top.

Example

const p = 0.8; // degree (0..1) of top-weightedness of the RBO metric
const rbo = new RBO(p);

const listA = ['a', 'b', 'c', 'd', 'e']; // sorted ranked list
const listB = ['b', 'a', 'g', 'h', 'e', 'k', 'l', 'c'];

const result = rbo.calculate(listA, listB); // returns the similarity score achieved

Helpers

RBO.calcWeight(p, d)

Calculates the weight of first d rankings with parameter p to help inform the choice of the parameter p.

const p = 0.9; // degree (0..1) of top-weightedness of the RBO metric
const d = 10; // ranking
const pWeight = RBO.calcWeight(p, d);

js-rbo's People

Contributors

holmberd avatar konsumer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

js-rbo's Issues

Support for ties

RBO is designed to support ties. Is this implemented at the moment?

Undefined Var

When running the example:

const RBO = require('rbo')
const rbo = new RBO(0.8)
const comparison = rbo.calculate(['a', 'b', 'c', 'd', 'e'], ['b', 'a', 'g', 'h', 'e', 'k', 'l', 'c'])

I get the following error:

/node_modules/rbo/rbo.js:87
  if (s.shortDepth != -1){
  ^

ReferenceError: s is not defined
    at RBO.update (/Users/lukenimtz/src/gummicube/gp-data-analysis/node_modules/rbo/rbo.js:87:2)
    at RBO.calculate (/Users/lukenimtz/src/gummicube/gp-data-analysis/node_modules/rbo/rbo.js:51:8)
    at Object.<anonymous> (/Users/lukenimtz/src/gummicube/gp-data-analysis/analyze.js:12:24)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:187:16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.