course content

Course Content

Handwritten Digits Recognition: Unlocking the Magic of Machine Learning

Handwritten Digits Recognition: Unlocking the Magic of Machine Learning

Train Test SplittingTrain 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

  1. Import the train_test_split function from sklearn;
  2. Use the train_test_split() to split X and y into their train and test parts;
  3. 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.