You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll try to produce a minimal reproducible example, but I tried a few caret methods, and it did not go wrong for any of them. However, it went wrong when using the ctree classifier from the party library, since it seems to be strict at not accepting that the test set has doubles instead of integers.
As you can see, I make a class that is used to predict using the ctreemodel. the data.frame("false" = 1-., "true" = .) only works for binary classification, but that is not the issue here since it is easy to extend to multiclass classification. party proceeds to throw the following error:
Error in checkData(oldData, RET) :
Classes of new data do not match original data
Note that this error does not occur when I comment out the FT$Age <- as.integer(FT$Age) line.
I used browser() during the predict.myclass function, and it turned out that the newdata passed by lime had its integer variable replaced by a double. Then, it goes wrong during the predict(model[[1]], newdata, type = "prob") code, since this function expects Age to be an integer, but lime converted it to a double somehow.
The text was updated successfully, but these errors were encountered:
I'll try to produce a minimal reproducible example, but I tried a few caret methods, and it did not go wrong for any of them. However, it went wrong when using the ctree classifier from the party library, since it seems to be strict at not accepting that the test set has doubles instead of integers.
As you can see, I make a class that is used to predict using the ctreemodel. the
data.frame("false" = 1-., "true" = .)
only works for binary classification, but that is not the issue here since it is easy to extend to multiclass classification. party proceeds to throw the following error:Note that this error does not occur when I comment out the
FT$Age <- as.integer(FT$Age)
line.I used
browser()
during thepredict.myclass
function, and it turned out that thenewdata
passed by lime had its integer variable replaced by a double. Then, it goes wrong during thepredict(model[[1]], newdata, type = "prob")
code, since this function expectsAge
to be an integer, but lime converted it to a double somehow.The text was updated successfully, but these errors were encountered: