From the course: Applied Machine Learning: Ensemble Learning (2022)
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Write out all train, validation, and test sets - Python Tutorial
From the course: Applied Machine Learning: Ensemble Learning (2022)
Write out all train, validation, and test sets
- [Instructor] In this video, we're going to split up our full data set. So we have 60% of our examples in the training set, 20% in the validation set and 20% in the test set. Doing this kind of split will help us evaluate the models and perform model selection using unbiased results. Let's start by importing the packages we'll need and read in our data. So we're going to this train test split method imported from Scikit-learn and this is going to make our job here very easy. I also want to call out that we're reading in this Titanic cleaned dataset that we created in the last video. So let's run that cell and get into splitting up our data. We're going to start by splitting our data into our features by dropping the survive column and our labels or our target variable, which in our case is whether somebody survived or not. Then we're going to call the train test split method and the first thing we need to do is pass in our…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.