nearest-vector
Find the nearest point to a sample point
Installation
$ npm install ml-nearest-vector
API Documentation
Example
; const nearestVector = ; let centers = 1 2 1 -1 -1 -1;// returns the index of the nearest vector === 0; // returns the nearest vector itself; // [1, 2, 1]