Using fancyRpartPlot with model that has no splits

Hi, I'm an undergrad student currently working on an assignment that requires us to use Rstudio to perform data mining. I have chosen this data set
It is to predict future seismic bumps with the result being binary(hazardous"1" or non-hazardous"0")

I'm planning to do a decision tree and I'm currently facing some issues. I was following what I was taught in class and are using fancyRpartPlot and this error occurs"

Error in apply(model$frame$yval2[, yval2per], 1, function(x) x[1 + x[1]]) :

dim(X) must have a positive length

I believe that the reason might be that the model has no split. Therefore does anyone know how to solve this?

In addition, when I use the code prp(seismicPruned) On the plot panel of the bottom right side of R, nothing appeared but a boxed 0, I think that might be also be related to the error.

In short, I am completely new to R, I have just started a week ago and tbh I have no idea what I'm doing so my question might be worded weirdly but I really need some help!!

Thanks for everyone who read this long ass post!

BTW this is what it appears when I use the command prp(seismicPruned)

@SpFervro You should add a reproducible example so people in the community can have an idea of the package you're using, the code you wrote and so on.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.