r descr_models("svm_linear", "kernlab")
defaults <- tibble::tibble(parsnip = c("cost", "margin"), default = c("1.0", "0.1")) param <- svm_linear() %>% set_engine("kernlab") %>% make_parameter_list(defaults)
This model has r nrow(param)
tuning parameters:
param$item
Parsnip changes the default range for cost
to c(-10, 5)
.
svm_linear( cost = double(1), margin = double(1) ) %>% set_engine("kernlab") %>% set_mode("regression") %>% translate()
svm_linear( cost = double(1) ) %>% set_engine("kernlab") %>% set_mode("classification") %>% translate()
The margin
parameter does not apply to classification models.
Note that the "kernlab"
engine does not naturally estimate class probabilities. To produce them, the decision values of the model are converted to probabilities using Platt scaling. This method fits an additional model on top of the SVM model. When fitting the Platt scaling model, random numbers are used that are not reproducible or controlled by R's random number stream.
The "Fitting and Predicting with parsnip" article contains examples for svm_linear()
with the "kernlab"
engine.
Lin, HT, and R Weng. "A Note on Platt’s Probabilistic Outputs for Support Vector Machines"
Karatzoglou, A, Smola, A, Hornik, K, and A Zeileis. 2004. "kernlab - An S4 Package for Kernel Methods in R.", Journal of Statistical Software.
Kuhn, M, and K Johnson. 2013. Applied Predictive Modeling. Springer.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.