[scikit-learn] Can Scikit-learn decision tree (CART) have both continuous and categorical features?

C W tmrsg11 at gmail.com
Fri Sep 13 22:38:16 EDT 2019


Hello all,
I'm very confused. Can the decision tree module handle both continuous and
categorical features in the dataset? In this case, it's just CART
(Classification and Regression Trees).

For example,
Gender Age Income  Car   Attendance
Male     30   10000   BMW          Yes
Female 35     9000  Toyota          No
Male     50   12000    Audi           Yes

According to the documentation
https://scikit-learn.org/stable/modules/tree.html#tree-algorithms-id3-c4-5-c5-0-and-cart,
it can not!

It says: "scikit-learn implementation does not support categorical
variables for now".

Is this true? If not, can someone point me to an example? If yes, what do
people do?

Thank you very much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20190913/9fb698d8/attachment.html>


More information about the scikit-learn mailing list