Documentation
Documentation copied to clipboard
GPLearn Demo Throws Runtime Error
from gplearn.genetic import SymbolicTransformer
features = np.array([
[1.0, 2.0, 3.0],
[2.0, 3.0, 4.0],
[3.0, 4.0, 5.0],
[4.0, 5.0, 6.0],
[5.0, 6.0, 7.0]
])
labels = np.array([6.0, 9.0, 12.0, 15.0, 18.0])
gp_transformer = SymbolicTransformer()
gp_transformer.fit(features, labels)
To avoid this error, we need to downgrade scikit-learn to 1.5.2 https://github.com/trevorstephens/gplearn/issues/304
This is fixed in the legacy env, reference https://github.com/QuantConnect/Lean/pull/9020