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 - Python Tutorial
From the course: NLP with Python for Machine Learning Essential Training
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…
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.
Contents
-
-
-
-
-
-
-
(Locked)
What is machine learning?4m 2s
-
(Locked)
Cross-validation and evaluation metrics7m 48s
-
(Locked)
Introducing random forest3m 4s
-
(Locked)
Building a random forest model8m 11s
-
(Locked)
Random forest with holdout test set12m 2s
-
(Locked)
Random forest model with grid search8m 48s
-
(Locked)
Evaluate random forest model performance8m 44s
-
(Locked)
Introducing gradient boosting4m 13s
-
(Locked)
Gradient-boosting grid search9m 44s
-
(Locked)
Evaluate gradient-boosting model performance9m 32s
-
(Locked)
Model selection: Data prep8m 25s
-
(Locked)
Model selection: Results9m 52s
-
(Locked)
-