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

[Feature]: can I design a custom operator for sequence data? #205

Open
callmedxx opened this issue May 7, 2023 · 1 comment
Open

[Feature]: can I design a custom operator for sequence data? #205

callmedxx opened this issue May 7, 2023 · 1 comment

Comments

@callmedxx
Copy link

Feature Request

I want to use SymbolicRegression.jl to analyze stock market data. Specifically, I need to design a rolling operator to process time series data, similar to rolling_sum in pandas. The input of this operator consists of time series data, the window size, and the sliding stride required for rolling. How can I design such an operator for SymbolicRegression.jl?

@MilesCranmer
Copy link
Owner

By input to the operator, do you mean input to the expression?

You can learn expressions over time series without extra effort by simply repeating/reshaping your time series data to have shape:

(window_size * num_features, num_examples)

if you have three variables in your time series say x y and z, and your window size is 2, then you would have features x_1, y_1, z_1, x_2, y_2, z_2 - where x_2 is simply the previous value of x.

For this sort of reshaping I recommend https://github.com/mcabbott/TensorCast.jl

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

No branches or pull requests

2 participants