I am creating bag of visual words using bagOfFeatures() function for my dataset. Here I wanted to know for how many number of clusters do I get a good accuracy value., so I kept changing the values of k from 50 to 400 in steps of 50. like {50,100,150,200,250 ..... 400}. and i get a good accuracy at k=250. This k value I want to validate by Using Particle Swarm optimization (PSO).
How i can proceed further. Your inputs are more important to me.
What I have tried:
I refereed these links till now, but not able to understand fully.. How i can write it for k means of my problem.
https://www.udemy.com/pso-in-matlab/learn/v4/questions
https://in.mathworks.com/matlabcentral/fileexchange/52857-particle-swarm-optimization-pso
https://in.mathworks.com/matlabcentral/fileexchange/67804-particle-swarm-optimization-pso-matlab-code-explanation
https://in.mathworks.com/matlabcentral/fileexchange/62998-particle-swarm-optimization-pso-tutorial
https://in.mathworks.com/matlabcentral/fileexchange/49010-particle-swarm-optimization