2
$\begingroup$

According to a website (:http://dataaspirant.com/2017/01/30/how-decision-tree-algorithm-works/) , these values are chosen randomly: enter image description here

I don't think this is the case with any optimized solution of a decision tree. In this image(different example) the value is 2.45 for the root node: enter image description here

Was this value chosen randomly like explained in the website? If not and the value is not chosen randomly then how is it calculated?

$\endgroup$
0
$\begingroup$

In principle, it considers all possible splits, ordering the samples by the feature value and calculating the gini index (or other criterion) improvement for each split. It then chooses the cutoff value to achieve the split in the ordered samples.

In practice, some optimization occurs, ignoring constant features, using approximated criterion improvements, etc.

https://github.com/scikit-learn/scikit-learn/blob/7389dbac82d362f296dc2746f10e43ffa1615660/sklearn/tree/_splitter.pyx#L304

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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