Skip to content

TimeSeriesSplit with anchour option #8249

Closed

Description

@rspadim

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]
...

Activity

  1. jnothman commented on Jan 31, 2017

    @jnothman
    Member

    I would consider a max_train_size option to TimeSeriesSplit.

  2. rspadim commented on Jan 31, 2017

    @rspadim
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions