2

I read https://www.researchgate.net/post/How_to_compute_impurity_using_Gini_Index

I understand why choosing smallest gini index, but how do I come up with different candidate splits in the first place? How does R come up with the splits? Take the iris data as an instance:

plot(iris$Sepal.Length, col=iris$Species, pch=20)

enter image description here

How do I determine where I want to draw the horizontal line to separate each class? I can draw infinitely amount of lines and then compare their gini index, but practically, it will not work.

Leo Jiang
  • 21
  • 1
  • there is no other way, not the infinite but yes on multiple values. Machine has computation power unlike us. you can write rpart on console and see the code urself.( in R, rpart in added ) – Arpit Sisodia Jun 15 '18 at 14:16

0 Answers0