1
$\begingroup$

I am trying to compare importance of over 100 features using xgboost. My question is, for xgboost (or any tree based methods), for Non-ordinal categorical features such as "race" (categorized as 0, 1, 2, 3).

  1. It makes more sense to one-hot code "race" or not.
  2. If yes, then how to compare the "importance of race" to other features. Should I sum-up importance of race_0, race_1, race_2, race_3, then compare it to other features?

Add more information: The label (the Y feature) is binary. and I am using the xgboost library come with sklearn. I am following steps in this post https://machinelearningmastery.com/feature-importance-and-feature-selection-with-xgboost-in-python/.

$\endgroup$
1
  • $\begingroup$ details? where have you looked? what have you tried? Are you wanting qualitative feedback? What is the heart of the statistical question? Do you know about the "Boruta" library, where you can plug in the xgboost importance measure (I think)? $\endgroup$ Oct 30, 2017 at 18:26

1 Answer 1

0
$\begingroup$

You should add up the importances of one-hot encoded features as the importance of the original feature. See https://stackoverflow.com/questions/40047343/how-to-explain-feature-importance-after-one-hot-encode-used-for-decision-tree

$\endgroup$

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.