we get an overall score and model accuracy of approximately %as depicted in figure - which is not bad for start looking at the class based statisticswe can see the recall for the high quality wine samples is pretty bad since lot of them have been misclassified into medium and low quality ratings this is kind of expected since we do not have lot of training samples for high quality wine if you remember our training sample sizes from earlier considering low and high quality rated wine sampleswe should at least try to see if we can prevent our model from predicting low quality wine as high and similarly prevent predicting high quality wine as low interpreting this modelyou can use the following code to look at the feature importance scores based on the patterns learned by our model in [ ]wqp_dt_feature_importances wqp_dt feature_importances_ wqp_dt_feature_nameswqp_dt_feature_scores zip(*sorted(zip(wqp_feature_nameswqp_dt_feature_importances)key=lambda xx[ ])y_position list(range(len(wqp_dt_feature_names))plt barh(y_positionwqp_dt_feature_scoresheight= align='center'plt yticks(y_position wqp_dt_feature_namesplt xlabel('relative importance score'plt ylabel('feature' plt title('feature importances for decision tree'figure - feature importances obtained from our decision tree model we can clearly observe from figure - that the most important features have hanged as compared to our previous model alcohol and volatile acidity occupy the top two ranks and total sulfur dioxide seems to be one of the most important features for classifying both wine type and quality (as observed in figure - if you rememberwe mentioned earlier that you can also easily visualize the decision tree structure from decision tree models and check out the decision rules that it learned from the underlying features used in prediction for new data samples the following code helps us visualize decision trees