0

i am currently working on timeseries forecasting, and I have to split the data into a training set and a test set. (Have the first 70% of the data be in the training set)

However, i cannot use the train_test_split function because it will shuffle the rows. How else I can split the data

desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • Do you have an ID of which is train and which is test? if not, is it just that you need the first 70% of your data to be training and the rest is for testing? – Mit May 14 '20 at 14:17
  • yep it's just i need to make the first 70% as my training. – Cookie Monster May 14 '20 at 14:24
  • Hi Cookie Monster, please familiarise yourself with [asking questions](https://stackoverflow.com/help/how-to-ask) before you write your next question! Enjoy your stay at SO :) – Diggy. May 14 '20 at 14:50

1 Answers1

0

You can actually use train_test_split , but setting shuffle = False

https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html

desertnaut
  • 57,590
  • 26
  • 140
  • 166
ale_C
  • 51
  • 6