knn

0.0.2 • Public • Published

K nearest neighbor for objects

var k = require('./lib/index');

var center = { a: 1, b: 2 },
    neighbor = { a: 1, c: 4 };

k.neighbor( center, neighbor ); // return 2 for distance from center to neighbor

neighbor = { a: 1, b: 2 };

k.neighbor( center, neighbor ); // return 0 for distance from center to neighbor

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    1

Package Sidebar

Install

npm i knn

Weekly Downloads

1

Version

0.0.2

License

BSD

Last publish

Collaborators

  • kaiquewdev