DEAP / deap

Distributed Evolutionary Algorithms in Python
http://deap.readthedocs.org/
GNU Lesser General Public License v3.0
5.75k stars 1.12k forks source link

why my halloffame updated using a bad sample? #517

Open nickhuangxinyu opened 3 years ago

nickhuangxinyu commented 3 years ago

my evaluate function will return two real-value, let's call it metric1 and metric2

I define fitness as: creator.create("FitnessMax", base.Fitness, weights=(1.0,1.0,))

I print the halloffame variable out, here is:

update halloffame is (0.8175977684148793, 0.6112177807296504)
64  7       0.54186     0.0828243   0.457871    0.817598
update halloffame is (0.8719212295960616, 0.0)
65  8       0.455689    0.239281    0           0.823035

i want the model to consider metric1 and metric2 equally, but i think this iteration increase metric1 by a little, but loss metric 2 a lot. that wasnt what i want.

i try to read the HallofFame update function, but it's a little hard for me.

So, can anyone help on this? (how does the update work and how shall i do if i want to consider two metrics equally)?

fmder commented 3 years ago

Multi objective fitness are considered lexicographically by the hall of fame you need to use pareto front.