Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would there be a way to produce the equivalent Python code for the program coming from the symbolic regress or #287

Open
c0def0x01 opened this issue Feb 18, 2023 · 1 comment

Comments

@c0def0x01
Copy link

c0def0x01 commented Feb 18, 2023

Is there a way with gplearn to get the program provided by the symbolic regressor e.g. ˋsub(div(mul(X4, X12), div(X9, X9)), sub(div(X11, X12), add(X12, X0)))ˋ into an executable Python program e.g.

def prog(X0, X4, X9, X11, X12):
    return  … (X4 * X12) …

Would it be useful to enhance this in gplearn, or is there better ways to do this?

@trevorstephens
Copy link
Owner

Not really sure what is gained here? The whole package has the functionality to essentially execute the program via the .predict methods.

The closest might be to extract the underlying _Program objects and work with those directly. I don't have any plans at this stage to make those object accessible via a public API at this stage though.

If you just want to use the program later, you can export it: https://gplearn.readthedocs.io/en/stable/advanced.html#exporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants