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 - Python Tutorial
From the course: Python Statistics Essential Training
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…
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.