As far as I can understand, we're using prob_to_class_2
as the default option when predicting class.
prob_to_class_2 <- function(x, object) {
x <- ifelse(x >= 0.5, object$lvl[2], object$lvl[1])
unname(x)
}
However, in many cases, the threshold is not 0.5. (Especially in imbalanced datasets.)
In this case, I wonder if we could use the threshold_perf()
function in the probably
package during the tuning process to check if the model is potentially classifying really well.
I think it's a really necessary feature, what do you think?