r descr_models("svm_rbf", "kernlab")

Tuning Parameters

defaults <- 
  tibble::tibble(parsnip = c("cost","rbf_sigma", "margin"),
                 default = c("1.0", "see below", "0.1"))

param <-
  svm_rbf() %>% 
  set_engine("kernlab") %>% 
  make_parameter_list(defaults)

This model has r nrow(param) tuning parameters:

param$item

There is no default for the radial basis function kernel parameter. kernlab estimates it from the data using a heuristic method. See [kernlab::sigest()]. This method uses random numbers so, without setting the seed before fitting, the model will not be reproducible.

Translation from parsnip to the original package (regression)

svm_rbf(
  cost = double(1),
  rbf_sigma = double(1), 
  margin = double(1)
) %>%  
  set_engine("kernlab") %>% 
  set_mode("regression") %>% 
  translate()

Translation from parsnip to the original package (classification)

svm_rbf(
  cost = double(1),
  rbf_sigma = 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.

Preprocessing requirements



Case weights


Saving fitted model objects


Examples

The "Fitting and Predicting with parsnip" article contains examples for svm_rbf() with the "kernlab" engine.

References



Try the parsnip package in your browser

Any scripts or data that you put into this service are public.

parsnip documentation built on Aug. 18, 2023, 1:07 a.m.