Open waltergms opened 6 years ago
For drawKnn()
, the first parameter is the matrix of train instances, the second parameter is the classes of train instances and the third parameter is a vector of your test instance’s features. The chart util for kNN will draw points for both train instances and the test instance and the different colors of those points represents different classes.
You know, the test instance's class is not known, so it will draw a special point for the test instance's features vector here is normalInx
(normalized inx
). As color of the point represents different classes, the color of the test instance is default to be white. You can see it in README
example. @waltergms
I belive that it is not a bug, but i want to draw the results and dont know what should go on inx values...
let inx = [7.0, 0.27, 0.36, 20.7, 0.045, 45.0, 170.0, 1.001, 3.0, 0.45, 8.8]