Closed AmosJoseph closed 11 months 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)?
'creator' creates a class named FitnessMin above. You can call it any name you like. It is not related to min or max.
FitnessMin
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)?