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.

Model selection: Results

Model selection: Results - Python Tutorial

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

Start my 1-month free trial

Model selection: Results

- [Instructor] We'll pick up right where we left off last time. If you're just joining us, go ahead and run all the cells preceding the cell for Final evaluation of models. Now we have all of our data prepared. So we have our training set with our vectorized data and our created features, and then we also have our test set that was transformed using the vectorizer trained only on the training set. Let's jump into final model selection. First, we'll just import RandomForestClassifier and GradientBoostingClassifier from sklearn.ensemble, and then we'll import our scoring function from sklearn.metrics. Then, one more function that we're importing here. This one's called time. This will allow us to track how long it's taking for our models to train and predict, because, as you'll see in just a few minutes, that's one factor that comes into play as part of final model selection. We'll go ahead and run that. For the next couple cells, I've included template code because we've already…

Contents