I use kernlab and randomforest for classification.
I was wondering when I was comparing the output of (type = prob) with the output of (type = class).
How are the thresholds determined? (>0.5 ? >=0.5 ?)
Does it change depending on the package?
Where should I look for the source code? ( r-source stats::predict ??)
predict() is a generic that has methods defined in each package; the correct method is chosen depending on the class of the model. Use the class() function to determine it.
For example, if class(obj) == "randomForest", predict(obj) is automatically calling randomForest::predict.randomForest(obj).
For example, for randomForest. For kernLab, there are several predict() methods that are chosen depending on the model, e.g. predict.gausspr(), same for qkr and ksvm.