I'm kind of a new R user and i'm trying to use rpart
to create a decision tree for me over some data. I then use a plot function (FancyPlot
) to plot the tree it made. Each node contains several numbers (the %s of instances in the node and the ration of the 2 classes inside).
I would like to know how are those numbers calculated? I've seen that there is a cross validation option in the parameters of the rpart, and it is not clear to me if the numbers in each node are of the whole train set or for the best CV set only.
I've tried to read the function itself, to see how was it coded, but i arrived to a line "rpfit <- .Call(C_rpart,...
" and got stuck there. How can i read that C_rpart
function? I could not find it anywhere.
I assume it is some sort of C code, but still, cant find it anywhere.