i am trying to select 3 feature from a data set of 24*461. my problem is in generation part. after cross-over, new chromosome can have more than three 1 and therefore more than three variable. in mutation step, when a zero is changed to one, number of selected feature is more than 3. Any help will be greatly appreciated
A common technique to solve this problem is to impose a "penalty", wherein, any chromosome that have more than three 1 have a penalty added. For example if a chromosome have five 1, add 2x to chromosome fitness score. In this case any chromosome that have more than three 1, gradually Remove from population and permitting other (that have three or less 1) individuals to be maintained in the population.