I met a problem when using gplearn. My application senario is as below:
I would like to build a trading strategy using M features as input, so my train_X shape is (N_train, M)
I would like to predict y using gplearn as the signal, and I don't have an ideal y at the beginning, I just want to get the best-performance y during the generation learning process.
Because of the reason in point 2, my custom metric function will use features such as [stoploss price, high price, low price] and so on to calculate the final net_value performance of the signals(y), which are not contained in my train_X.
However, I met problem when trying to find an elegent way to pass necessary features into the custom metric function.
The way I use now is by using a global variable, which I don't think is a good idea:
Does anyone have an elegant way to deal with my scenario?
Here everyone,
I met a problem when using gplearn. My application senario is as below:
However, I met problem when trying to find an elegent way to pass necessary features into the custom metric function.
The way I use now is by using a global variable, which I don't think is a good idea:
Does anyone have an elegant way to deal with my scenario?