
Parsnip model specs: epsilon-SVR with MAPE loss (Model 1)
psvr_mape_specs.RdCreate parsnip model specifications for psvr_mape() with a fixed kernel
type. Kernel parameters are tunable parsnip arguments; the symmetry
parameter a and solver tolerance are engine arguments passed via
set_engine().
Usage
psvr_mape_rbf(
mode = "regression",
engine = "psvr",
cost = NULL,
margin = NULL,
rbf_sigma = NULL,
sym_type = NULL
)
psvr_mape_poly(
mode = "regression",
engine = "psvr",
cost = NULL,
margin = NULL,
degree = NULL,
scale_factor = NULL,
sym_type = NULL
)
psvr_mape_linear(
mode = "regression",
engine = "psvr",
cost = NULL,
margin = NULL,
sym_type = NULL
)Arguments
- mode
Only
"regression"is supported.- engine
Only
"psvr"is available.- cost
Regularization parameter
C > 0. Usehardhat::tune()to optimize. Mapped tocost_psvr(), whose default range is[-2, 10]on the log2 scale (about 0.25 to 1024). That range is adequate here, where typical \(\epsilon\)-SVR optima lie in [10, 100]. The LS-SVR specs (psvr_rmspe_specs) mapcostto \(\Gamma\) and need a much wider range; see there.- margin
Epsilon tube half-width \(\epsilon \ge 0\) expressed as a percentage of each target value. Use
hardhat::tune()to optimize. Mapped tomargin_percentage()with default range[1, 20](percentage units). Named to matchparsnip::svm_rbf(); note the units differ fromdials::svm_margin(), which is absolute rather than percentage.- rbf_sigma
RBF bandwidth \(\sigma > 0\). Use
hardhat::tune()to optimize. Mapped torbf_sigma_psvr(), whose default range[-3, 1]on the log10 scale is a fixed, conservative fallback. The range does not finalize automatically from the training data.rbf_sigma_psvr()setsfinalize = NULL, sodials::finalize()leaves it untouched. To centre the range on the data, passrbf_sigma_psvr_data()computed on the preprocessed predictors explicitly — viaupdate()on the extracted parameter set, or viapsvr_option_add()for a workflow set. (RBF specs only.)- sym_type
Symmetry type:
"none"(default) fits the non-symmetric \(\epsilon\)-SVR of Model 1;"even"(a = 1) and"odd"(a = -1) fit the symmetric \(\epsilon\)-SVR of Model 2. Usehardhat::tune()to optimise over the levels during CV; seesym_type_param()to restrict which levels are searched.- degree
Polynomial degree \(\ge 1\). Use
hardhat::tune()to optimize. (Polynomial specs only.)- scale_factor
Polynomial constant term (
coef0). Usehardhat::tune()to optimize. (Polynomial specs only.)
Examples
library(parsnip)
spec <- psvr_mape_rbf(cost = 10, margin = 1, rbf_sigma = 1) |>
set_engine("psvr")
spec_poly <- psvr_mape_poly(cost = 10, margin = 1, degree = 2,
scale_factor = 1) |>
set_engine("psvr")
spec_lin <- psvr_mape_linear(cost = 10, margin = 1) |>
set_engine("psvr")
# Symmetric epsilon-SVR (Model 2) via the sym_type argument:
spec_sym <- psvr_mape_rbf(cost = 10, margin = 1, rbf_sigma = 1,
sym_type = "even") |>
set_engine("psvr")