Hi Mattias,
> You did a really good work with DEAP and also the documentation!
Thanks, it is always appreciated.
> Unfortunately, some parts of the documentation are a bit vague in my opinion. I managed to set-up a nice STGP and it works like a charm. The problem is, that I don't know how to save and load the individuals. I tried to use checkpoints/pickle as in the documentation but it just outputs an error stating that pickle needs a string, not a byte-object.
It is hard to know exactly what went wrong without the source code, the exact error and the Python interpreter version.
There is a small precision that should be added to the checkpointing tutorial regarding GP concerning the pickling protocol. In order to pickle gp.PrimitiveTree, it is required to specify the protocol argument to dump, and set to a level equal to 2 or higher. However, this does not seem to be your problem.
If you find some that some parts of the documentation are vague, you are more than welcome to indicate us the different sections and how we could improve them.
> The second possibility I saw was the "seeding"-approach with JSON. I have zero experience with JSON and I'm not sure, how the input-file should look like and if it is even possible to seed a population with STGP individuals.
JSON has a limited set of types it can serialize, and gp.PrimitiveTree is not in it. You should stick with pickle.
> Thirdly, I stumbled upon he gp.PrimitiveTree.from_string function. I managed to get it running somehow (although I found a bug I just added to the issue list) but I don't think that I really understood how to use from_string.
We are currently working on your bug report. That said, from_string was not originally implemented as a way to checkpoint PrimitiveTree. It was more meant to make the creation of trees from scratch easier, since working with primitives and terminals can be cumbersome and counterintuitive.
> It would be great, if you could offer a little example about how to save and load individuals!
If you could share your code on how you tried to pickle and unpickle GP trees, we could start from that to show you an example on how you should do it.
> Thank you!
> Mattias
Thank you for your interest for DEAP,
Félix-Antoine