gplearn
gplearn copied to clipboard
Limiting tree depth
I'm trying to use gplearn to automate feature engineering.
I have two questions:
- Is it possible to limit the depth of the programs (not only the initial depth)? I'm looking for "interpretable" features, which would correspond to shallower trees...
- Is it possible to pass a list of feature names such that the output of the best programs would be more informative?
Interesting idea for # 1. Shall think on it.
On # 2... Can you give more details on the use-case? You don't want to use some features? Why include them in X
then?
Or you just want to see the output more readable? Sounds like #73 perhaps?
Yes, definitely related!
What I had in mind is printing add(feature_name_1,feature_name_17)
instead of add(X1,X17)
; for example, by passing an optional features_names
list to the print
method.
@trevorstephens
A reference may be helpful ...
https://github.com/DEAP/deap/blob/f6accf730555c5bbc1c50ac310250ad707353080/deap/gp.py#L891-L914
It seems like that they just replace the one violates the max depth constraint with a new random one