1
$\begingroup$

I am trying to build a decision tree using python and sklearn DecisionTreeClassifier.

One of the data_type used for splitting the tree is Boolean(let it be x).However the tree that is generated contains comparisons like x<=0.5 . This does not make sense.

Can anybody suggest how to use boolean values in Decision trees.

$\endgroup$
1
  • $\begingroup$ x >= 0 and x < 0.5 corresponds to 0. While x >= 0.5 to x <= 1 correspons to 1. In practice, sklearn converts categorical values to continuous values for use in Decision Trees. $\endgroup$
    – Kshitiz
    Jul 25 '17 at 16:54
1
$\begingroup$

Why would this not make sense? It tries to create a split with maximal separation between signal and background. Any float >0 and < 1 will result in the same split.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.