Can sklearn random forest directly handle categorical features?

后端 未结 3 551
予麋鹿
予麋鹿 2020-12-04 11:35

Say I have a categorical feature, color, which takes the values

[\'red\', \'blue\', \'green\', \'orange\'],

and I want to use it to predict something in a ra

3条回答
  •  一整个雨季
    2020-12-04 12:09

    No, there isn't. Somebody's working on this and the patch might be merged into mainline some day, but right now there's no support for categorical variables in scikit-learn except dummy (one-hot) encoding.

提交回复
热议问题