trevorstephens / gplearn

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

Is it possible to specify a starting function #36

Open jherbel opened 7 years ago

jherbel commented 7 years ago

For a number of our problems, we have a rough of a functional form that should be close to the "right answer". Is there a way to feed this in as the initial starting point for the symbolic regression algorithm?

trevorstephens commented 7 years ago

No, this is not currently implemented. Will leave the issue open to determine if there's much interest in this.

jherbel commented 7 years ago

Ok, thanks!

SaremS commented 7 years ago

Would be very helpful if this was implemented.

pchankh commented 6 years ago

Yes, I second this feature.

AnaKolody commented 5 years ago

I would also be interested in this feature.

eggachecat commented 5 years ago

Currently you can use some tricks mentioned in #39

eggachecat commented 5 years ago

17 related

shiyu-syl commented 4 years ago

Yes it would be really helpful. btw, what can I do if I really need to specify a staring expression now?

trevorstephens commented 4 years ago

@SibylLi If you really, really wanted to, you could run a single generation with the parameters you want to use, then replace all the individual Program objects with whatever you wanted to "seed" the population with, then continue evolution with warm_start. Check out the test suite for some undocumented examples on how to create Program objects from scratch, and the docs for warm starting: https://gplearn.readthedocs.io/en/stable/advanced.html#continuing-evolution

The Program API is not documented, so you're kind of on your own here if you wish to go down that path.

Arya0815 commented 4 years ago

It would be very helpful! BTW, could I generate the initial population by considering some prior-knowledge, e.g. the some feature of xdata corresponding to ydata, instead of randomly generating it? @trevorstephens

ghost commented 4 years ago

"Is it possible to specify a starting function", yes @trevorstephens say how to with the seed param... but every version determine the result... so i mean is it possible and practical to train a model of ML to determine the seed produce the desired first element code... or can just use the "datamining" concept at start of program. and then, never mind the solution choose, use a CRC func to verify the precise version digital print and store in a temporary locate(to never run a 2nd start of verification of determinist specific function desired).

trevorstephens commented 2 years ago

I think I will create a notebook to show how this could be "hacked" into gplearn which will satisfy this request with no new code to maintain.

acylam commented 12 months ago

@trevorstephens Checking if this feature is added or if there's a notebook showing the "hack"?

I think I will create a notebook to show how this could be "hacked" into gplearn which will satisfy this request with no new code to maintain.

gbarros92 commented 2 months ago

@trevorstephens Checking if this feature is added or if there's a notebook showing the "hack"?

I think I will create a notebook to show how this could be "hacked" into gplearn which will satisfy this request with no new code to maintain.

Jatayu-u commented 3 weeks ago

@trevorstephens Is this implemented? I am in a similar situation where I need to implement this with some starting functions. It would be great if anybody could help.