What is the real value
2 views (last 30 days)
Show older comments
Hello every body,
I tried to optimize features selection problem using GA,and the optimizing code implementing well, but the problem is, when i get the results. the result is like that 1 0 0 1 1 0 0 0 1 0 1 0 0 1 0 1 1 0 1 1 1 1 0 0 0 0 0 1 which is the x selected of GA, What is that mean?? how i can recognize the real value selected??
dlmwrite('selected.GA',x,'delimiter','\n');
2 Comments
Accepted Answer
Star Strider
on 2 Jun 2015
That result is the optimal vector of ‘features’ (in your implementation) that your GA has selected. To understand what it means, give it as the argument to your fitness function and see what the output is.
2 Comments
Walter Roberson
on 2 Jun 2015
The first feature was selected. The second and third were not selected. The fourth was selected. The fifth was selected. And so on.
Star Strider
on 14 Jun 2015
The ga fitness function takes only one argument, a vector with one element for each variable you want to optimise. So if your fitness function is named ‘fitfun’, do something like this:
V = [1 0 0 1 1 0 0 0 1 0 1 0 0 1 0 1 1 0 1 1 1 1 0 0 0 0 0 1];
out = fitfun(V)
The ‘out’ variable is a scalar value that is the result of its evaluating ‘V’. That is up to you to interpret.
You may want to create a second version of ‘fitfun’ if you want output that is more meaningful than a single scalar value (perhaps one that tells you in detail the features the genetic algorithm has chosen).
More Answers (0)
See Also
Categories
Find more on Genetic Algorithm 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!