View source: R/wfs-svm-poly-reg.R
ts_wfs_svm_poly | R Documentation |
This function is used to quickly create a workflowsets object.
ts_wfs_svm_poly(
.model_type = "kernlab",
.recipe_list,
.cost = 1,
.degree = 1,
.scale_factor = 1,
.margin = 0.1
)
.model_type |
This is where you will set your engine. It uses
|
.recipe_list |
You must supply a list of recipes. list(rec_1, rec_2, ...) |
.cost |
A positive number for the cose of predicting a sample within or on the wrong side of the margin. |
.degree |
A positive number for polynomial degree. |
.scale_factor |
A positive number for the polynomial scaling factor. |
.margin |
A positive number for the epsilon in the SVM insensitive loss function (regression only.) |
This function expects to take in the recipes that you want to use in the modeling process. This is an automated workflow process. There are sensible defaults set for the model specification, but if you choose you can set them yourself if you have a good understanding of what they should be. The mode is set to "regression".
This only uses the option set_engine("kernlab")
and therefore the .model_type
is not needed. The parameter is kept because it is possible in the future that
this could change, and it keeps with the framework of how other functions
are written.
parsnip::svm_poly()
svm_poly() defines a support vector machine model.
For classification, the model tries to maximize the width of the margin
between classes. For regression, the model optimizes a robust loss function
that is only affected by very large model residuals.
This SVM model uses a nonlinear function, specifically a polynomial function, to create the decision boundary or regression line.
Returns a workflowsets object.
Steven P. Sanderson II, MPH
https://workflowsets.tidymodels.org/
https://parsnip.tidymodels.org/reference/svm_poly.html
Other Auto Workflowsets:
ts_wfs_arima_boost()
,
ts_wfs_auto_arima()
,
ts_wfs_ets_reg()
,
ts_wfs_lin_reg()
,
ts_wfs_mars()
,
ts_wfs_nnetar_reg()
,
ts_wfs_prophet_reg()
,
ts_wfs_svm_rbf()
,
ts_wfs_xgboost()
suppressPackageStartupMessages(library(modeltime))
suppressPackageStartupMessages(library(timetk))
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(rsample))
data <- AirPassengers %>%
ts_to_tbl() %>%
select(-index)
splits <- time_series_split(
data
, date_col
, assess = 12
, skip = 3
, cumulative = TRUE
)
rec_objs <- ts_auto_recipe(
.data = training(splits)
, .date_col = date_col
, .pred_col = value
)
wf_sets <- ts_wfs_svm_poly("kernlab", rec_objs)
wf_sets
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.