hi @bethatkinson I ran into an error from rpart when using it to train/predict on a small classification data set (in which cross-validation makes even smaller data sets where there can be missing classes), tdhock/mlr3resampling#80
A simpler way to reproduce the same issue is
> rpart::rpart(y~x, data.frame(y=factor("pos"),x=1:2))
Error in cbind(yval2, yprob, nodeprob) :
number of rows of matrices must match (see arg 2)
I would have expected a more informative error such as, "y has only one class, but at least two are required"
Similarly,
> rpart::rpart(y~x, data.frame(y=factor("pos"),x=1))
Error in yprob[, i] : subscript out of bounds
an error which would be more helpful for the user: "data has only one row, but rpart needs at least two"
hi @bethatkinson I ran into an error from rpart when using it to train/predict on a small classification data set (in which cross-validation makes even smaller data sets where there can be missing classes), tdhock/mlr3resampling#80
A simpler way to reproduce the same issue is
I would have expected a more informative error such as, "y has only one class, but at least two are required"
Similarly,
an error which would be more helpful for the user: "data has only one row, but rpart needs at least two"