Handwritten Digits Recognition: Unlocking the Magic of Machine Learning
Train Test Splitting
In Python, the
train_test_split function from the
sklearn.model_selection module is commonly used to split a dataset into training and testing subsets.
train_test_split() function randomly splits a dataset into two subsets: a training set and a testing set, based on the specified test size or train size.
- Import the
train_test_splitfunction from sklearn;
- Use the
yinto their train and test parts;
- Print the size of each of target vectors (train and test).
Everything was clear?