Course Name: Trading with Machine Learning: Regression, Section No: 7, Unit No: 2, Unit type: Notebook
Why don't we use the train test split function from sklearn than manually doing the split ourselves?
Hi Lee,
We can use the train_test_split function from sklearn as well. What is done in the notebook, is just another approach. Make sure that while using the train_test_split you specify shuffle = False, as we want the first 80% data for the train and remaining for the test, as below
train_test_split(X, yU, test_size = 0.2, shuffle = False)
Hope this answers your question.