[scikit-learn] A necessary feature for Decision trees

Brown J.B. jbbrown at kuhp.kyoto-u.ac.jp
Thu Jan 4 02:30:34 EST 2018


Dear Yang Li,

> Neither the classificationTree nor the regressionTree supports
categorical feature. That means the Decision trees model can only accept
continuous feature.

Consider either manually encoding your categories in bitstrings (e.g.,
"Facebook" = 001, "Twitter" = 010, "Google" = 100), or using OneHotEncoder
to do the same thing for you automatically.

Cheers,
J.B.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20180104/1fcb028c/attachment.html>


More information about the scikit-learn mailing list