当前位置: 动力学知识库 > 问答 > 编程问答 >

how to use Genetic algorithm in matlab for selection of specific number of features?

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: