Closed statistics88 closed 3 years ago
Can I contribute here?
Can I contribute here?
Sorry for the delay. Yes. You can
SVM models do not naturally produce class probabilities. The decision values are used (pairwise by class) in a secondary model to convert them to class probabilities (see Platt scaling). The kernlab
package does this internally and the results can vary (and setting the seed has no effect 😞 ).
When class probabilities are requested, we compute the class probabilities then derive the predicted class (see getModelInfo("svmRadialSigma")[[1]]$predict
). This may differ from the hard class predictions that you get when no probabilities are requested.
tl;dr
It happens in kernlab
and we have no control over it.
Minimal, reproducible example:
Minimal dataset:
The results with and without classProbs=TRUE is not same.
Minimal, runnable code:
The results are different for 8 rows when the predicted probability is close to 0.5.