values = df.values
train, test = train_test_split(values)
#Split into train and test
X_train, y_train = train[:, :-1], train[:, -1]
X_test, y_test = test[:, :-1], test[:, -1]
Executing the above code splits the time series dataset into training- 75% and testing 25%. I want to control the train-test split as 80-20 or 90-10. Can someone please help me understand how to split the dataset into any ratio I want?
The concept is borrowed from https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/.
Note : I cannot split the dataset randomly for train and test and the most recent values have to be for testing. I have included a screenshot of my dataset.
If anyone can interpret the code, please do help me understand the above. Thanks.