saumitrajagdale
saumitrajagdale
DIIDevHeads IoT Integration Server
Created by wafa_athmani on 3/12/2024 in #firmware-and-baremetal
implement a KNN (K-Nearest Neighbors) model for classification in MATLAB
Conventionally, the value of k is taken as sqrt(N) where N is the number of data points in your dataset. But a better approach is to take a random sample (5% of your main dataset) and use the trial and error method to find the optimal k value that works best for that particular sample. Statistically, the optimal k value you find out in that sample should also be the optimal k value for your entire dataset.
3 replies