| .fit.svm | R Documentation |
tidyfitFits a support vector regression or classification on a 'tidyFit' R6 class. The function can be used with regress or classify.
## S3 method for class 'svm'
.fit(self, data = NULL)
self |
a 'tidyFit' R6 class. |
data |
a data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). |
Hyperparameters:
cost (cost of constraint violation)
epsilon (epsilon in the insensitive-loss function)
Important method arguments (passed to m)
The function provides a wrapper for e1071::svm. See ?svm for more details.
Implementation
The default value for the kernel argument is set to 'linear'. If set to a different value, no coefficients will be returned.
A fitted 'tidyFit' class model.
Johann Pfitzinger
Meyer D, Dimitriadou E, Hornik K, Weingessel A, Leisch F (2022). e1071: Misc Functions of the Department of Statistics, Probability Theory Group (Formerly: E1071), TU Wien. R package version 1.7-12, https://CRAN.R-project.org/package=e1071.
.fit.boost, .fit.lasso and m methods
# Load data
data <- tidyfit::Factor_Industry_Returns
data <- dplyr::filter(data, Industry == "HiTec")
# Stand-alone function
fit <- m("svm", Return ~ `Mkt-RF` + HML + SMB, data, cost = 0.1)
fit
# Within 'regress' function
fit <- regress(data, Return ~ ., m("svm", cost = 0.1),
.mask = c("Date", "Industry"))
coef(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.