Does predict function work in parallel when predicting k-nearest neighbour?
Show older comments
Hi there,
I have a k-nearest neighbour classifier which I have trained with fitcknn. I am wondering, when predicting labels on the model using predicit does it work in parallel?
I have tested using predict in a for loop and parfor loop. The simple for loop performs a bit faster which makes me think there is some optimisation and built in parallelisation that the predict function is taking advantage of. However, the documentation makes no reference to this, and I thought MATLAB always runs in a single thread unless specifically using a parallel pool? In both cases, I am supplying the predict function with a vector of 1000 rows of test data at a time. Although my test dataset is a million rows, I am doing this so I can get see progress while the program is making predictions.
So basically:
- Does the predict function use parallisation on k-nn models?
- Any other tips to increase test time when using a large k-nn model?
Accepted Answer
More Answers (0)
Categories
Find more on Parallel and Cloud in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!