0.0.2 • Published 12 years ago

knn v0.0.2

Weekly downloads
1
License
-
Repository
-
Last release
12 years ago

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