run_svm | R Documentation |
run_svm
is a wrapper function that applies the support vector machine
classifier to data provided by the user, evaluates prediction performance,
and chooses the best-performing model.
run_svm(
y,
L1.x,
L2.x,
L2.eval.unit,
L2.unit,
L2.reg,
kernel = "radial",
loss.fun,
loss.unit,
gamma,
cost,
data,
verbose,
cores
)
y |
Outcome variable. A character vector containing the column names of
the outcome variable. A character scalar containing the column name of
the outcome variable in |
L1.x |
Individual-level covariates. A character vector containing the
column names of the individual-level variables in |
L2.x |
Context-level covariates. A character vector containing the
column names of the context-level variables in |
L2.eval.unit |
Geographic unit for the loss function. A character scalar
containing the column name of the geographic unit in |
L2.unit |
Geographic unit. A character scalar containing the column
name of the geographic unit in |
L2.reg |
Geographic region. A character scalar containing the column
name of the geographic region in |
kernel |
SVM kernel. A character-valued scalar specifying the kernel to
be used by SVM. The possible values are |
loss.fun |
Loss function. A character-valued scalar indicating whether
prediction loss should be measured by the mean squared error ( |
loss.unit |
Loss function unit. A character-valued scalar indicating
whether performance loss should be evaluated at the level of individual
respondents ( |
gamma |
SVM kernel parameter. A numeric vector whose values specify the gamma parameter in the SVM kernel. This parameter is needed for all kernel types except linear. Default is a sequence with minimum = 1e-5, maximum = 1e-1, and length = 20 that is equally spaced on the log-scale. |
cost |
SVM cost parameter. A numeric vector whose values specify the cost of constraints violation in SVM. Default is a sequence with minimum = 0.5, maximum = 10, and length = 5 that is equally spaced on the log-scale. |
data |
Data for cross-validation. A |
verbose |
Verbose output. A logical argument indicating whether or not
verbose output should be printed. Default is |
cores |
The number of cores to be used. An integer indicating the number of processor cores used for parallel computing. Default is 1. |
The support vector machine tuned parameters. A list.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.