Splitting the dataset with Scikit-Learn.
Classes, functions, and methods:
train_test_split
- Scikit-Learn class for splitting a dataset into two parts. Thetest_size
argument states how large the test set should be. Therandom_state
argument sets a random seed for reproducibility purposes.df.reset_index(drop=True)
- reset the indices of a dataframe and delete the previous ones.df.x.values
- extract the values from x seriesdel df['x']
- delete x series from a dataframe
The entire code of this project is available in this jupyter notebook.
The notes are written by the community. If you see an error here, please create a PR with a fix. |