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] PySRSequenceRegressor #94

Open
MilesCranmer opened this issue Jan 30, 2022 · 7 comments · May be fixed by #677
Open

[Feature] PySRSequenceRegressor #94

MilesCranmer opened this issue Jan 30, 2022 · 7 comments · May be fixed by #677
Assignees
Labels
enhancement New feature or request

Comments

@MilesCranmer
Copy link
Owner

To define a symbolic regression model predict recurrent relations in sequences, I want to create a PySRSequenceRegressor (see #88 for scikit-learn API) that will automatically set this up for the user given a sequence X.

This would require basically no core modifications. It's just a preprocessing step. This could also be used to model any sort of fixed step size time series data, including differential equations (although the learned symbolic model would just be single-step prediction; not rollouts), so I think this would be a nice addition.

The required arguments for this would be: history_length which tells the data preprocessing how many historical features to allocate a single datapoint for it to predict the next step.

The user would be allowed to pass a 1D array (single sequence) or a 3D array (batch of sequences with multiple features each). This will not allow for 2D arrays as input since this is ambiguous with regard to batching vs multi-feature. Passing a 2D array will raise an error telling the user to pass a 3D array, and give the expected axis configuration.

A 3D array as input will raise a warning letting the user know which axis is being interpreted as batch/feature. This warning could be silenced with a flag.

The user could also use PySRRegressor and do the preprocessing themselves.

(cc @patrick-kidger @kazewong, in case of interest)

@MilesCranmer MilesCranmer added the enhancement New feature or request label Jan 30, 2022
@MilesCranmer MilesCranmer self-assigned this Jan 30, 2022
@MilesCranmer MilesCranmer removed their assignment Apr 20, 2023
@falknerdominik
Copy link

Hello,

Could this be currently implemented? If yes can you specify how the preprocessing would look like (I might be interested to try this on data I currently work on).

@wenbang24
Copy link

wenbang24 commented Jul 15, 2024

Hello,

This sounds really great for time series data, but as falknerdominik said, how would the preprocessing work?
Anyway, I would also be interested in working on this :)

@MilesCranmer
Copy link
Owner Author

It should be fairly straightforward to implement. Just need to find some time to do it. I think it could wrap PySRRegressor with a fixed loss_function, and handle flattening/unflattening the data to predict and fit.

Since I've evidently been too busy to add this so far, let me know if one of you would be interested in working on it and I can point you in the right direction.

@wenbang24
Copy link

I would be happy to work on this!

@wenbang24
Copy link

@MilesCranmer can you assign this to me pls?

@wenbang24
Copy link

@MilesCranmer I'm writing a research paper on symbolic regression for recurrence relations; can I pls use this in my paper?

@wenbang24
Copy link

wenbang24 commented Jul 21, 2024

also is it

$f(x_t) = f(x_{t-1}) + f(x_{t-2}) +$ whatever

or

$f(x_t) = x_{t-1} + x_{t-2} +$ whatever

@wenbang24 wenbang24 linked a pull request Jul 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants