def eval_symb_reg(individual, points, values):
try:
func = toolbox.compile(expr=individual)
sqerrors = [(func(*z) - valx)**2 for z, valx in zip(points, values)]
return math.log10(math.sqrt(math.fsum(sqerrors)) / len(points)),
except OverflowError:
return 1000.0,
# register the selection and genetic operators - tournament selection and, one point crossover and sub-tree mutation
评论列表
文章目录