decision tree in R error:fit is not a tree,just a root

good afternoon! I have problem with a decisional trees.

f11<-as.factor(Z24train$f1)
fit_f1 <- rpart(f11~TSU+TSL+TW+TP,data = Z24train,method="class")
plot(fit_f1, uniform=TRUE, main="Classification Tree for Kyphosis")

But this error appears:

Error in plot.rpart(fit_f1, uniform = TRUE, main = "Classification Tree for Kyphosis") : 
  fit is not a tree, just a root

which is the problem? thanks for the help 🙂

Leave a Comment