def eval_func(individual, points):
# Transform the tree expression in a callable function
func = toolbox.compile(expr=individual)
# Evaluate the mean squared error
mse = ((func(x) - (2 * x**3 - 3 * x**2 + 4 * x - 1))**2 for x in points)
return math.fsum(mse) / len(points),
# Function to create the toolbox
symbol_regression.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录