Can sklearn random forest directly handle categorical features?

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.

Leave a Comment