Why are probabilities and response in ksvm in R not consistent?
I am using ksvm from the kernlab package in R to predict probabilities, using the type="probabilities" option in predict.ksvm . However, I find that sometimes using predict(model,observation,type="r") yields not the class with the highest probability given by predict(model,observation,type="p") . Example: > predict(model,observation,type="r") [1] A Levels: A B > predict(model,observation,type="p") A B [1,] 0.21 0.79 Is this correct behavior, or a bug? If it is correct behavior, how can I estimate the most likely class from the probabilities? Attempt at reproducible example: library(kernlab)