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

I don't think this is the case with any optimized way of creating 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?


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.


| cite | improve this answer | |

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.