0

I have run a decsision tree with 62 idependent variables to predict stock prices. However, when extracting the feature importance with classifier_DT_tuned$variable.importance, I only see the importance of 55 and not 62 variables.

I would have expected that the decision tree picks up the most important variables but then would assign a 0.00 in importance to the not used ones. Could you please help me out and elaborate on this issue? Thanks!

1 Answers1

0

Did you try getting the feature importance like below:

feat_importance = list(dt_clf.tree_.compute_feature_importances())

This will give you the list of importance for all the 62 features/variables.

DesiKeki
  • 220
  • 2
  • 6