src-d / kmcuda

Large scale K-means and K-nn implementation on NVIDIA GPU / CUDA
Other
806 stars 145 forks source link

predict method #32

Closed draculayuan closed 6 years ago

draculayuan commented 6 years ago

Thanks for the lib! May I know if there is an method like kmeans_gpu.predict that i can use to predict which cluster does a new point belong to?

vmarkovtsev commented 6 years ago

Thank you very much for your feedback. Indeed, there is currently no function for new dots. I have received a few requests for this feature and will eventually add it. Stay tuned.

draculayuan commented 6 years ago

Thanks vmarkovstsev for you reply! May I know if there is any otherway to assign a new point to one of the existing clusters? For example, get centroids by applying kmeans_cuda on the training data, then use kmeans_cuda() again with "init = centroids" on the new point but not updating centroids? Then we take the assignment returned by kmeans_cuda as the predicted result?

vmarkovtsev commented 6 years ago

Yes, this will work.

draculayuan commented 6 years ago

Thanks! May I check how to make sure the kmeans_cuda wont update centroids?

vmarkovtsev commented 6 years ago

kmeans_cuda always returns the new centroids so you can easily check :smile: But it really does not update them with tolerance=1.

draculayuan commented 6 years ago

Ohh i see! Thank you so much!