trevorstephens / gplearn

Genetic Programming in Python, with a scikit-learn inspired API
http://gplearn.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.59k stars 281 forks source link

How to force minimum length to be 2? #249

Closed replacementAI closed 2 years ago

replacementAI commented 2 years ago

Whenever I run SymbolicRegressor, the average length decreases to between 1-2 and best length decreases to 1 in a few generations (it also has a weird output of a number like -.428, but I'm not sure how to use that). This happens regardless of the population size, generations, parsimony coefficient, and function set, so I want to know if there is a way to force the minimum length to always be 2?

trevorstephens commented 2 years ago

No sorry that is not supported

replacementAI commented 2 years ago

I think I "fixed" it, I made all genetic operations = 0 except for p_point_mutation = 1

trevorstephens commented 2 years ago

Ah that's pretty clever actually 🤩