Skip to contents

Support Vector Machine

Usage

renoir_svm(
  x,
  y = NULL,
  weights = NULL,
  offset = NULL,
  resp.type,
  observations = NULL,
  features = NULL,
  clean = FALSE,
  keep.call = TRUE,
  ...,
  use.nusvm = FALSE,
  kernel = "radial",
  degree = 3,
  gamma = NULL,
  coef0 = 0,
  cost = 1,
  nu = 0.5,
  epsilon = 0.1,
  fitted = FALSE,
  verbose = F
)

Arguments

x

the input matrix, where rows are observations and columns are variables

y

the response variable. Its number of rows must match the number of rows of x

weights

priors of the observations

offset

used only for GLM methods, it is an a priori known component to be included in the linear predictor during fitting

resp.type

the response type

observations

indices of observations to keep

features

indices of predictors to keep

...

further arguments to svm

kernel

the kernel used in training and predicting. You might consider changing some of the following parameters, depending on the kernel type.

linear:

\(u'v\)

polynomial:

\((\gamma u'v + coef0)^{degree}\)

radial basis:

\(e^(-\gamma |u-v|^2)\)

sigmoid:

\(tanh(\gamma u'v + coef0)\)

degree

parameter needed for kernel of type polynomial (default: 3)

gamma

parameter needed for all kernels except linear (default: 1/(data dimension))

coef0

parameter needed for kernels of type polynomial and sigmoid (default: 0)

cost

cost of costraint violation (must be >0)

nu

re-parametrization of cost which controls the number of support vectors and the margin errors. It must be in range (0, 1]. Note that for classification nu must be nu * length(y)/2 <= min(table(y))

epsilon

epsilon in the insensitive-loss function (default: 0.1)

fitted

logical indicating whether the fitted values should be computed and included in the model or not (default: TRUE)

Value

An object of class Trained

Author

Alessandro Barberis