From the course: Python Statistics Essential Training

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Solution: Predict Ames

Solution: Predict Ames

(upbeat music) - [Instructor] Let's explore a solution to this challenge. The first thing I want to do is inspect my XG boost model and see if I can get those features from that. So here's my XG boost model. Remember, we discussed that it has an attribute called feature_importances_ that ends in underscore, again that underscore meaning that attribute was learned when we fit the model. So here's our feature_importances_, this is a NumPy array of the importance of each feature. This corresponds with the training data. So we should be able to stick this into a Panda series and get the names of that. So I'm going to say let's stick those values into a Panda series. And for the index I'm going to use the columns from the training data. Let's look at what that looks like. That's looking pretty good. I'm going to stick this into a chain. Now I want to sort these values. Let's just look at what that looks like when we sort…

Contents