Kim,
The "x" in "xerror" and "xstd" stands for cross validation. But you have
specified no cross validations, xval=0.
Try:
model <- rpart(Product ~ ., data=trainData, control=rpart.control(minsplit=50,
cp=0.002))
model$cptable
Jean
On Tue, Feb 3, 2015 at 7:09 AM, Kim C. wrote:
> Hello all,
Hello all,
I'm making a decision tree with the rpart package. I want to prune the tree and
in many tutorials it says to use cptable. Like so: opt <-
which.min(model_rpart$cptable[, "xerror"])
The problem is that when I look up model_rpart$cptable it only show the columns
CP, nsplit, rel error.
2 matches
Mail list logo