From the course: NLP with Python for Machine Learning Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Random forest with holdout test set

Random forest with holdout test set - Python Tutorial

From the course: NLP with Python for Machine Learning Essential Training

Start my 1-month free trial

Random forest with holdout test set

- [Instructor] Now that we've learned how to build and evaluate a very basic random forest model using cross-validation, let's learn how to create and use a holdout test set to allow us to explore the results in a little more detail. We'll start by reading in our data, creating our new features, cleaning that data, and then vectorizing it. So we'll go ahead and run that cell, and that returns the same data frame that we've been working with, with all of our vectorized data and our two newly created features. Now, the first step is to import the precision recall F score support function, from the SK learn dot metrics module. And we're going to go ahead and store that as score, so that we don't have to call the entire function name every time that we want to use it. And then we'll import the train test split function from SK learn dot model selection. So the first step is to split our data into a training set, and a test set. So we'll call our train test split function, and what we'll…

Contents