13 – M7L7 13 Feature Importance Solution V1

Let’s go ahead and calculate the feature importances. The importance of feature zero is the importance of a node where it was used for splitting which is node two divided by the total node importances. Similarly, for feature one, the importance of feature one is the node importance where it was used for splitting which … Read more

12 – M7L7 13 Feature Importance Solution V1

Let’s go ahead and calculate the feature importances. The importance of feature zero is the importance of a node where it was used for splitting which is node two divided by the total node importances. Similarly, for feature one, the importance of feature one is the node importance where it was used for splitting which … Read more

11 – M7L7 11 Node Importance Solution V1

Okay, so the quiz is asking us to calculate the node importance of node two. So it’s quite similar to what we did up here. We’re going to get the weighted number of samples for node two times the impurity of node two, and then compare that to the impurities of its children. We’re getting … Read more

10 – M7L7 10 Node Importance Intro V1

Now let’s calculate the node importance. The node importance in sklearn is calculated as the difference between the Gini impurity of the node, the parent node, and the impurities of its child nodes. These Gini impurities are weighted by the number of data points that reach each node. So if we think, for instance, the … Read more

1 – L7 Intro V1

Let’s talk about a topic of growing importance, which is a machine learning interpretability. It’s often the case that in business applications, companies may choose to use a simple linear model rather than a complex nonlinear model for the sake of interpretability. When you build a model, you’ll need to be able to understand how … Read more