[R] predict function type class vs. prob

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Sat Sep 23 21:21:54 CEST 2023

В Fri, 22 Sep 2023 10:12:51 +0000
"Milbert, Sabine (LGL)" <Sabine.Milbert using lgl.bayern.de> пишет:

> PS: If this is an issue based on the model training function of the
> caret package and therefore not your responsibility, please let us
> know.

Indeed, as Rui Barradas said, predict() is a generic function. Calling
it with your model as an argument resolves to a function in the caret

It's hard to say without looking at your code and data (the R-help
posting guide has some hints on how to prepare a reproducible example),
but I think that the caret package fits your linear SVM models using
kernlab::ksvm, and then predict() resolves to a combination of
kernlab::predict (potentially with the argument type = "probabilities")
and kernlab::lev.

Try replicating your results using just the kernlab package.

Best regards,

More information about the R-help mailing list