Skip to content

Instantly share code, notes, and snippets.

@avisheknag17
Created September 15, 2020 12:18
Show Gist options
  • Save avisheknag17/6551868e72c59744e0d2af04431fd00e to your computer and use it in GitHub Desktop.
Save avisheknag17/6551868e72c59744e0d2af04431fd00e to your computer and use it in GitHub Desktop.
from sklearn.model_selection import TimeSeriesSplit
tss = TimeSeriesSplit()
for train_index, test_index in tss.split(X,Y):
Y_train, Y_test = Y.iloc[train_index], Y.iloc[test_index]
X_train, X_test = X.iloc[train_index], X.iloc[test_index]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment