heal-research / pyoperon

Python bindings and scikit-learn interface for the Operon library for symbolic regression.
MIT License
38 stars 11 forks source link

TypeError: cannot pickle 'pyoperon.pyoperon.Variable' object #7

Closed dspanah closed 1 year ago

dspanah commented 1 year ago

I'm tryring to save a pyoperon model using pickle:

from pyoperon.sklearn import SymbolicRegressor
reg = SymbolicRegressor()
reg.fit(X_train, y_train)

filename = 'operon_model.sav'
pickle.Dump(reg, open(filename, 'wb'))

but I get the following error:

TypeError: cannot pickle 'pyoperon.pyoperon.Variable' object

Can help me with this issue? Thanks

foolnotion commented 1 year ago

Hi, thanks for the bug report and sorry for the delayed reply. A fix for this issue will be included in the next release of pyoperon, which should happen within the week.