ShuhuaGao / geppy

A framework for gene expression programming (an evolutionary algorithm) in Python
https://geppy.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
207 stars 76 forks source link

question about "minimize" #47

Closed AmosJoseph closed 11 months ago

AmosJoseph commented 1 year ago

from deap import creator, base, tools

creator.create("FitnessMin", base.Fitness, weights=(-1,)) # to minimize the objective (fitness) creator.create("Individual", gep.Chromosome, fitness=creator.FitnessMin)


Hi, pardon, in the examples of geppy, there writes "Our objective is to minimize the MSE (mean squared error) for data fitting" using above code.

"FitnessMin" is used, and weights=(-1,). Then this is maximization. But why it is still to minimize the objective (fitness)?

ShuhuaGao commented 1 year ago

'creator' creates a class named FitnessMin above. You can call it any name you like. It is not related to min or max.