Rookfighter / knn-cpp

A header-only C++ library for k nearest neighbor search with Eigen3.
MIT License
51 stars 5 forks source link

Classification 2 classes and 60 Querypoints #3

Closed Youssef-Zarca closed 2 years ago

Youssef-Zarca commented 3 years ago

I have 2 classes and I want to see if the 60 points are one of these 2 classes. The problem is that I can’t get much data when I implement this algorithm with more than 1 nearest neighbor, cause I get a lot of -1 output otherwise.

please how can I use this algorithm with 2 classes and 60 points to be classified with k=7 without getting -1 in the output? Please can I iterate in the algorithm and adding points to the classes to be looked for as neighbors or the algorithm do that automatically?

Rookfighter commented 3 years ago

Hi and thanks for using knn-cpp. I am happy to help you as best as I can. First off, can you give me a bit more details on your data? Like:

Maybe you can also post some example code on how you use the KDTree, so I can get more insights into your problem.

Youssef-Zarca commented 3 years ago

Thank you so much for your reply as well. Actually I have solved the problem. I have used the library wrong. Now my Datapoints are the EEG Chanels Features and the query points are the reference features, which I need to look for their next k Neighbors.

The KDTree is the one in the readme file with Euclidean distance. From the distances Matrix I do the classification.

thank you deeply