knn
knn copied to clipboard
A k-nearest neighboor classifier algorithm.
In a situation where 2 different nodes are the same distance from the test node, the returned label is always the last one. For example: ```js import KNN from 'ml-knn';...
When running the reproduction code: [Reproduction](https://gist.github.com/tommed/818ab42c9dfa942a6b026f70c6c2a5fb) The following error occurs when loading from JSON: > node_modules\ml-distance-euclidean\euclidean.js:6 d += (p[i] - q[i]) * (p[i] - q[i]); ^ TypeError: Cannot read property...
Uncaught TypeError: Cannot read property 'nearest' of undefined at O.getSinglePrediction (knn.js:91)
when i use web version, it pops me this error. Uncaught TypeError: Cannot read property 'nearest' of undefined at O.getSinglePrediction (knn.js:91)