python 哪个包里有 遗传算法

scikit-opt 调研过很多遗传算法库,这个挺好用的。目标函数def demo_func(x): x1, x2, x3 = x return x1 ** 2 + (x2 - 0.05) ** 2 + x3 ** 2from ga import GA调用遗传算法求解:ga = GA(func=demo_func, lb=[-1, -10, -5], ub=[2, 10, 2], max_iter=500)...
python 哪个包里有 遗传算法
当然是Biopython
http://biopython.org
里面常用的算法都有了。

https://pypi.python.org/pypi?%3Aaction=search&term=bioinformatics&submit=search
上面的链接里面有很多各种各样的库。2017-06-03
scikit-opt 调研过很多遗传算法库,这个挺好用的。
# 目标函数def demo_func(x): x1, x2, x3 = x return x1 ** 2 + (x2 - 0.05) ** 2 + x3 ** 2from ga import GA调用遗传算法求解:
ga = GA(func=demo_func, lb=[-1, -10, -5], ub=[2, 10, 2], max_iter=500)best_x, best_y = ga.fit()

甚至对tsp问题(Travelling Salesman Problem)也有很好的支持
ga_tsp = GA_TSP(func=cal_total_distance, points=points, pop=50, max_iter=200, Pm=0.001)best_points, best_distance = ga_tsp.fit()
2019-09-19
mengvlog 阅读 6 次 更新于 2025-07-19 17:38:51 我来答关注问题0
檬味博客在线解答立即免费咨询

Python相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部