Question

am doing my master research about EEG analysis with mat lab . After preprocessing and feature extraction , I suppose to classify my data with neural network and optimization my classify using genetic algorithm. I have a big problem with genetic algorithm that I don't know how to calculate the fitness function can any one help me please.
I

Was it helpful?

Solution

A fitness function is not something that can be calculated via a formula--developing one is a key part of using a genetic algorithm!

The fitness function for a genetic algorithm is used to tell how good a particular solution is. In this case, your fitness function should say how good a particular neural network is at classifying your data. I would expect the fitness function would be the rank accuracy of the neural network in classifying your test set, though that will depend on exactly how your genetic algorithm is implemented (e.g. if your GA defines 0 as perfect and deviation from 0 as bad, then you'd want to invert your fitness function so that higher rank accuracy means closer to 0. I'm not familiar with standard genetic algorithm libraries, so I can't really say whether that's likely to be true.)

Something you might run into is that your fitness function puts all your results too close together. In that case, you may want to spread them out by taking a multiple or an exponential of the rank accuracy. There are lots of ways you could transform it besides those two, but what will work best depends very much on how your genetic algorithm is implemented.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top