makes predictionsand is good example of machine learning algorithm that is easily explained to nonexperts howevereven with tree of depth fouras seen herethe tree can become bit overwhelming deeper trees ( depth of is not uncommonare even harder to grasp one method of inspecting the tree that may be helpful is to find out which path most of the data actually takes the n_samples shown in each node in figure - gives the number of samples in that nodewhile value provides the number of samples per class following the branches to the rightwe see that worst radius < creates node that contains only benign but malignant samples the rest of this side of the tree then uses some finer distinctions to split off these remaining benign samples of the samples that went to the right in the initial splitnearly all of them ( end up in the leaf to the very right taking left at the rootfor worst radius we end up with malignant and benign samples nearly all of the benign samples end up in the second leaf from the rightwith most of the other leaves containing very few samples feature importance in trees instead of looking at the whole treewhich can be taxingthere are some useful properties that we can derive to summarize the workings of the tree the most commonly used summary is feature importancewhich rates how important each feature is for the decision tree makes it is number between and for each featurewhere means "not used at alland means "perfectly predicts the target the feature importances always sum to in[ ]print("feature importances:\ {}format(tree feature_importances_)out[ ]feature importances we can visualize the feature importances in way that is similar to the way we visualize the coefficients in the linear model (figure - )in[ ]def plot_feature_importances_cancer(model)n_features cancer data shape[ plt barh(range(n_features)model feature_importances_align='center'plt yticks(np arange(n_features)cancer feature_namesplt xlabel("feature importance"plt ylabel("feature"plot_feature_importances_cancer(treesupervised machine learning algorithms