Search code examples
rmachine-learningclassificationsvmrapidminer

Change threshold for class prediction in R


How can I change the probability threshold to predict a class as 1 in R.

In rapidminer there is apply threshold operator. How can I achieve the same thing in R?

svm_model1 <- svm(x,y,probability = TRUE)
summary(svm_model1)
pred <- predict(svm_model1,x,probability = TRUE)

Solution

  • The model gives as output a vector of probabilities, only compare the output with a theshold in the case of a binary classification.