While running decision tree, I have unbalanced data. The data balance is 93%(Class 0) to 7% (Class 1).

Now when I am plotting decision tree to understand the factors contributing to class 1, then I find that most boxes are for 0 class (as it is 97% of the data).

Also, after pruning, very few contributors are there which are contributing to class 1. How can I get the factors contributing to class 1?


1 Answer 1


Which function are you using at Loss? Using the right one is important when dealing with imbalanced datasets. 7% is imbalanced, but not that bad.

Have you tried any eXplainable Artificial Intelligence (XAI) method? Normally I use Shap. It is really good to see which feature contributes in which direction. You can see an example here. Shap interpretation

  • $\begingroup$ Thanks, do you know equivalent package of "Shap" in R ? $\endgroup$
    – SKB
    Jan 30, 2020 at 8:49
  • $\begingroup$ Also i am anticipating that Shap results will also be biased to class 0 and will show important variables contributing to 0 detection. Here i am more interested in knowing variables contributing to 1. $\endgroup$
    – SKB
    Jan 30, 2020 at 8:55
  • $\begingroup$ About R, I dont know, there has to be something for sure. How about this rdocumentation.org/packages/iml/versions/0.9.0/topics/Shapley? $\endgroup$ Jan 30, 2020 at 9:34
  • $\begingroup$ Check this link for dealing with imbalanced dataset, but for your case choosing the right metric should be okey kdnuggets.com/2017/06/7-techniques-handle-imbalanced-data.html $\endgroup$ Jan 30, 2020 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.