Documentation icon indicating copy to clipboard operation
Documentation copied to clipboard

GPLearn Demo Throws Runtime Error

Open DerekMelchin opened this issue 6 months ago • 1 comments

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)
Image

To avoid this error, we need to downgrade scikit-learn to 1.5.2 https://github.com/trevorstephens/gplearn/issues/304

DerekMelchin avatar Oct 03 '25 17:10 DerekMelchin

This is fixed in the legacy env, reference https://github.com/QuantConnect/Lean/pull/9020

Image

Martin-Molinero avatar Oct 10 '25 15:10 Martin-Molinero