r descr_models("svm_linear", "LiblineaR")
defaults <- tibble::tibble(parsnip = c("cost", "margin"), default = c("1.0", "no default")) param <- svm_linear() %>% set_engine("LiblineaR") %>% make_parameter_list(defaults)
This model has r nrow(param)
tuning parameters:
param$item
This engine fits models that are L2-regularized for L2-loss. In the [LiblineaR::LiblineaR()] documentation, these are types 1 (classification) and 11 (regression).
Parsnip changes the default range for cost
to c(-10, 5)
.
svm_linear( cost = double(1), margin = double(1) ) %>% set_engine("LiblineaR") %>% set_mode("regression") %>% translate()
svm_linear( cost = double(1) ) %>% set_engine("LiblineaR") %>% set_mode("classification") %>% translate()
The margin
parameter does not apply to classification models.
Note that the LiblineaR
engine does not produce class probabilities. When optimizing the model using the tune package, the default metrics require class probabilities. To use the tune_*()
functions, a metric set must be passed as an argument that only contains metrics for hard class predictions (e.g., accuracy).
The "Fitting and Predicting with parsnip" article contains examples for svm_linear()
with the "LiblineaR"
engine.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.