I want to change the splitting method in rpart
function from "gini" (which is default) to "information".
In the help section we have this example:
fit2 <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis,
parms = list(prior = c(.65,.35), split = "information"))
in method
argument details we have:
"Alternatively, method can be a list of functions named init, split and eval. Examples are given in the file ‘tests/usersplits.R’ in the sources, and in the vignettes ‘User Written Split Functions"
and in the parms
argument details:
"The splitting index can be gini or information. The default priors are proportional to the data counts, the losses default to 1, and the split defaults to gini."
When I try to create the model:
model<-rpart(as.factor(char)~., data=train, split = "information")
Error: ***Argument split not matched***
I find this (and most of the) R help sections not very clear. Apparently I do not have the information option. Am I supposed to define the function for split before and then build my model?, or also input the probabilities vector? How can I use information like in the example?