gplearn icon indicating copy to clipboard operation
gplearn copied to clipboard

Limiting tree depth

Open adamhaber-atidot opened this issue 6 years ago • 4 comments

I'm trying to use gplearn to automate feature engineering.

I have two questions:

  1. 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...
  2. Is it possible to pass a list of feature names such that the output of the best programs would be more informative?

adamhaber-atidot avatar Jun 13 '18 09:06 adamhaber-atidot

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?

trevorstephens avatar Jun 13 '18 09:06 trevorstephens

Or you just want to see the output more readable? Sounds like #73 perhaps?

trevorstephens avatar Jun 13 '18 09:06 trevorstephens

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.

adamhaber-atidot avatar Jun 13 '18 10:06 adamhaber-atidot

@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

eggachecat avatar Mar 26 '19 11:03 eggachecat