I use PSO to find the best feature subset for classification. Population is analyzed every iteration in PSO in order to achieve the particle (best combination of features) that has the least cost (best fitness).
Every Particle is a vector with the length equal to the number of features. For example: We assumed that particle [1 0 1 1 0 1] is the best solution. This vector demonstrates that there are 6 features. F1, F3, F4, and F6 will be used and F2 and F5 will be ignored in the classification step.
How can I calculate the cost function of this population when I don't know the result of classification in advance?