Skip to content

TimeSeriesSplit with anchour option #8249

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

Closed
rspadim opened this issue Jan 30, 2017 · 2 comments · Fixed by #8282
Closed

TimeSeriesSplit with anchour option #8249

rspadim opened this issue Jan 30, 2017 · 2 comments · Fixed by #8282

Comments

@rspadim
Copy link

rspadim commented Jan 30, 2017

hi guys, i don't know yet how generators work with sklearn / python, i'm new here... could be possible a version of TimeSeriesSplit with rolling window?

https://www.mathworks.com/help/econ/rolling-window-estimation-of-state-space-models.html

for example instead of :
[0, 1, 2] [3]
[0, 1, 2, 3] [4]
[0, 1, 2, 3, 4] [5]
produce something like (window-size=2)
[0, 1] [2]
[1, 2] [3]
[2, 3] [4]
[4, 5] [6]
[5, 6] [7]
...

@jnothman
Copy link
Member

I would consider a max_train_size option to TimeSeriesSplit.

@rspadim
Copy link
Author

rspadim commented Jan 31, 2017

nice there's some info here:
http://topepo.github.io/caret/data-splitting.html#data-splitting-for-time-series
but this image cover 99% of timeseries cases (maybe one more variable about "rolling window step size" instead of rolling fixed +1, considering that each "line" ("step") of dataframe is one "timestamp"/"step") : http://topepo.github.io/caret/splitting/Split_time-1.png

i checked TimeSplit source code, there's a group not used
some dataframes are:

sensor_id,timestamp,value

maybe this could help split "groupying by" sensor_id, or something like it?
for example...

sensor_id,time
1,1
1,2
1,3
2,1
2,2
2,3

we should do:
[id=1,time=1] + [2,1] as "train", [1,2]+[2,2] as "test"
[1,2]+[2,2] as "train", [1,3]+[2,3] as "test"

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

Successfully merging a pull request may close this issue.

3 participants