How to know which generation is the best selected individual.

195 views
Skip to first unread message

Andreia Gualberto

unread,
Apr 5, 2020, 9:53:05 AM4/5/20
to deap-users
How to know which generation is the best selected individual. The generation of HallOfFame [0] using deap with the easimple algorithm?

François-Michel De Rainville

unread,
Apr 5, 2020, 4:00:39 PM4/5/20
to deap-...@googlegroups.com
You could track your logbook. The first generation with the fitness (min or max) equivalent to the best fitness is probably the generation at which appeared the best individual.


Le 5 avr. 2020 à 09:53, Andreia Gualberto <andreiag...@gmail.com> a écrit :

How to know which generation is the best selected individual. The generation of HallOfFame [0] using deap with the easimple algorithm?

--
You received this message because you are subscribed to the Google Groups "deap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deap-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/deap-users/8ae8627c-9488-461e-9f60-a65b6965f9ca%40googlegroups.com.

Andreia Gualberto

unread,
Apr 6, 2020, 2:07:30 PM4/6/20
to deap-users

this is an assumption, I needed something that was certain. Like this: 'hof [0] .getGeneration'


Em domingo, 5 de abril de 2020 17:00:39 UTC-3, François-Michel De Rainville escreveu:
You could track your logbook. The first generation with the fitness (min or max) equivalent to the best fitness is probably the generation at which appeared the best individual.
Le 5 avr. 2020 à 09:53, Andreia Gualberto <andreiag...@gmail.com> a écrit :

How to know which generation is the best selected individual. The generation of HallOfFame [0] using deap with the easimple algorithm?

--
You received this message because you are subscribed to the Google Groups "deap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deap-...@googlegroups.com.

Derek Tishler

unread,
Apr 6, 2020, 4:08:36 PM4/6/20
to deap-users
Are you working with a local copy of eaSimple? Like in your other question, have you tried adding the gen to each invalid_ind after both eval(but before hof update) to mark re-evaluated individuals with the current gen.

example:
fitnesses = toolbox.map(toolbox.evaluate, invalid_ind)
for ind, fit in zip(invalid_ind, fitnesses):
    ind
.fitness.values = fit
    ind
.generation = gen

if halloffame is not None:
    halloffame
.update(population)
Reply all
Reply to author
Forward
0 new messages