使用遗传算法进行稀疏参数选择
我面临一个参数选择问题,我想使用遗传算法(GA)来解决。 我应该从 3000 个可能的参数中选择不超过 4 个参数。 使用二元染色体表示似乎是一个自然的选择。 评估函数会惩罚太多“选定”属性,如果属性数量可以接受,则会评估选择。
问题在于,在这些稀疏条件下,遗传算法很难改善种群。 经过几代人的努力,平均健康成本和“最差”个体的健康状况都没有改善。 我所看到的只是最佳个体的分数略有(甚至微小)提高,我认为这是随机抽样的结果。
使用参数索引对问题进行编码也不起作用。 这很可能是因为染色体是有方向的,而选择问题不是(即染色体 [1, 2, 3, 4];[4, 3, 2, 1];[3, 2, 4, 1] 等是相同的)
您会建议什么问题表示?
PS 如果这很重要,我使用 PyEvolve。
I'm facing a parameter selection problem, which I would like to solve using Genetic Algorithm (GA). I'm supposed to select not more than 4 parameters out of 3000 possible ones. Using the binary chromosome representation seems like a natural choice. The evaluation function punishes too many "selected" attributes and if the number of attributes is acceptable, it then evaluates the selection.
The problem is that in these sparse conditions the GA can hardly improve the population. Neither the average fitness cost, nor the fitness of the "worst" individual improves over the generations. All I see is slight (even tiny) improvement in the score of the best individual, which, I suppose, is a result of random sampling.
Encoding the problem using indices of the parameters doesn't work either. This is most probably, due to the fact that the chromosomes are directional, while the selection problem isn't (i.e. chromosomes [1, 2, 3, 4]; [4, 3, 2, 1]; [3, 2, 4, 1] etc. are identical)
What problem representation would you suggest?
P.S If this matters, I use PyEvolve.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

我不熟悉 PyEvolve,但从我对遗传算法的记忆来看,您关心的是 4 个步骤,
我认为您可以使用列出来就好了。 您需要重载一些运算符,但看起来 PyEvolve 允许您执行此操作 一个简单的事情是保留列表表示,只需在返回染色体之前对它们进行数字排序。
我需要更多地了解你的问题,但这是我的建议。 由于参数数量可变,因此您需要得出染色体中参数数量的某种概率分布。 我在这里假设 1、2、3、4 是均匀随机的,但如果您更喜欢,可以尝试其他方法。 我将把这个分布称为 P_n。
现在,有很多方法可以解决这个问题,因此请采取对您的问题最有意义的方法。
I'm not familiar with with PyEvolve, but from what I can recall about Genetic algorithms, you are concerned with 4 steps,
I think you can do this with lists just fine. You'll need to overload some operators, but it looks like PyEvolve lets you do this A simple thing would be to keep the list representation, just sort them numerically before you return the chromosome.
I would need to know more about your problem, but here are my suggestions. Since you have a variable number of parameters, you need to come up with some sort of probability distribution for number of parameters in a chromosome. I'll assume a uniform random on 1,2,3,4 here, but you can try something else if you like that better. I'm going to call this distribution P_n.
Now, there are many ways to go about this, so do what makes the most sense for your problem.