Does predict function work in parallel when predicting k-nearest neighbour?
显示 更早的评论
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Parallel and Cloud 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!