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.

Feature evaluation

Feature evaluation - Python Tutorial

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

Start my 1-month free trial

Feature evaluation

- [Instructor] We're going to pick up right where we left off last lesson, so if you're just joining us, go ahead and run all the previous cells in this exercise notebook. Now that we've created two new features, we want to evaluate those features to see if they might be providing any new value to the model for distinguishing spam from non-spam. As I mentioned at the end of the previous lesson, we'll use overlayed histograms to look at the value of these created features. So we're going to import pyplot from matplotlib and we're going to import numpy and store it as np. And then we're going to tell Python to print out matplotlib inline right in our notebook. So the function call to build these histograms is pyplot.hist. So basically, we're going to build two histograms. The first is going to look at the distribution of our body length for spam, and then the second one is going to look at the distribution of body length for non-spam, and that's how we're going to use these histograms…

Contents