Dear Jeannie,
The problem you mention is rather a Python limitation than a problem with DEAP. As Marc-Andre mentionned in a now closed bug report on DEAP :
The Python parser has a depth limit somewhere between 92 and 99 when parsing an expression. For instance,
eval("("*100+"3"+")"*100)
will fail with a MemoryError exception thrown.
This means that you cannot open more that 92 (or 99) parenthesis without closing a single one.
This is what happens when GP trees have more than ~90 levels, plus the DEAP stuff around the tree evaluation that makes the stack larger than 92 or 99.
Anyhow, I doubt the problem you are tackling really requires trees that large and I think you are probably suffering from a common problem in GP called bloat, where trees are accumulating a lot of not useful stuff and the fitness stagnates.
As I'm not an expert on bloat control but Marc-Andre is. I'll leave it to him to suggest you a suitable solution. In the mean time, there are two operators that can help you in the bloat control section of the operator list:
http://deap.readthedocs.org/en/master/api/tools.html#operators
Don't hesitate to contact us if you have problems applying them. I don't think there are any example of bloat control out there.
Have fun with DEAP,
Best regards,
François-Michel
--
offspring = map(toolbox.clone, population))
for i in range(1, len(offspring), 2):
offspring[i-1], offspring[i] = toolbox.mate(offspring[i-1], offspring[i])--
All the algorithms from the algorithms module use the correct version.
What algorithm do you use? Can you provide a minimum example that reproduce the behavior?
Regards,
François-Michel
--