Important features for predicting attrition

1. Important features for predicting attrition

One of the main reasons we chose to use Decision Tree algorithm is that it provides interpretability. We can not only visualize and explain it, but we can also understand what are the important features that drive the decision to leave the company.

2. Feature Importances

Fortunately, once Decision Tree is developed, sklearn can easily calculate feature importances. The latter is equal to the relative decrease in Gini due to the selected feature. Once the calculation is done for all features, the values are rescaled to sum up to 100%. As a result, higher percentage speaks about the feature being more important. Usually, results show that not all the features are that important. As a consequence, if you learn that a feature is not important at all, it is suggested to drop it and run the model without that feature.

3. Let's practice!

Let's now find the important features in our dataset.