Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TimeSeriesSplit Needs a version that allows users to specify initial time #23923

Open
@alexhallam

Description

@alexhallam

Describe the workflow you want to enable

I would like to add a new TimeSeriesSplit link called TimeSeriesRollingOriginSplit. In the current TimeSeriesSplit it is not possible for users to get an initial length.

I am happy to open a PR for this myself if it is approved.

Describe your proposed solution

This is the proposed new TimeSeriesRollingOriginSplit
class sklearn.model_selection.TimeSeriesRollingOriginSplit(initial = 5, test_size = 1, gap = 0)

initial: the initial number of samples to use. it is often common to start with a larger training period.

test_size: Used to set the test_size

gap: Number of samples to exclude from the end of each train set before the test set.

Describe alternatives you've considered, if relevant

I currently use TimeSeriesSplit in a loop, but exclude the initial splits until the train set is the size I want.

Additional context

Again. I am happy to contribute this feature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions