12.8 SVM

Random forest models might be more popular than SVMs [support vector machines]; however, the positive effect of tuning hyperparameters on model performance is much more pronounced in the case of SVMs (Probst, Wright, and Boulesteix 2018)

  • ksvm from the kernlab package (which allows for hyperparameters to be tuned automatically)
  • C-svc: support vector classifier for classification task
# ERROR?  "Element with key 'classif.ksvm' not found in DictionaryLearner!"
# lrn_ksvm = mlr3::lrn("classif.ksvm", predict_type = "prob", kernel = "rbfdot", type = "C-svc")
lrn_svm = mlr3::lrn("classif.svm", predict_type = "prob", kernel = "radial",
                     type = "C-classification")
lrn_svm$fallback = lrn("classif.featureless", predict_type = "prob")
perf_level = mlr3::rsmp("repeated_spcv_coords", folds = 5, repeats = 100)