In order to make it ready for the learning models, normalize the dataset by applying MinMax scaling that brings the dataset values between 0 and 1. You can try applying different scaling methods to the data depending on the nature of your data.
# normalize the dataset
scaler = skpp.MinMaxScaler(feature_range=(0, 1))
normalized_dataset = scaler.fit_transform(dataset)
We use our homegrown utility function to split the dataset into train and test datasets. The data has to be split without shuffling the dataset as shuffling the dataset breaks the sequence. Maintaining the sequence of the data is important to train the time series models.
train,test=tsu.train_test_split(normalized_dataset,train_size=0.67)
Then we convert the train and test datasets into supervised machine learning sets. Let's try to understand the meaning...