Course Content
Handwritten Digits Recognition: Unlocking the Magic of Machine Learning
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.
The 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.
Task
- Import the
train_test_split
function from sklearn; - Use the
train_test_split()
to splitX
andy
into their train and test parts; - Print the size of each of target vectors (train and test).
Everything was clear?
Section 1. Chapter 6
Start learning today and achieve
coding mastery
- Master Python, SQL, JavaScript & more.
- Learn with Step-by-Step Lessons.
- Get Ready for Real-World Projects.
- Earn a Certificate Upon Completion.