Learn R Programming

MachineShop (version 3.8.0)

SVMModel: Support Vector Machine Models

Description

Fits the well known C-svc, nu-svc, (classification) one-class-svc (novelty) eps-svr, nu-svr (regression) formulations along with native multi-class classification formulations and the bound-constraint SVM formulations.

Usage

SVMModel(
  scaled = TRUE,
  type = character(),
  kernel = c("rbfdot", "polydot", "vanilladot", "tanhdot", "laplacedot", "besseldot",
    "anovadot", "splinedot"),
  kpar = "automatic",
  C = 1,
  nu = 0.2,
  epsilon = 0.1,
  prob.model = FALSE,
  cache = 40,
  tol = 0.001,
  shrinking = TRUE
)

SVMANOVAModel(sigma = 1, degree = 1, ...)

SVMBesselModel(sigma = 1, order = 1, degree = 1, ...)

SVMLaplaceModel(sigma = numeric(), ...)

SVMLinearModel(...)

SVMPolyModel(degree = 1, scale = 1, offset = 1, ...)

SVMRadialModel(sigma = numeric(), ...)

SVMSplineModel(...)

SVMTanhModel(scale = 1, offset = 1, ...)

Value

MLModel class object.

Arguments

scaled

logical vector indicating the variables to be scaled.

type

type of support vector machine.

kernel

kernel function used in training and predicting.

kpar

list of hyper-parameters (kernel parameters).

C

cost of constraints violation defined as the regularization term in the Lagrange formulation.

nu

parameter needed for nu-svc, one-svc, and nu-svr.

epsilon

parameter in the insensitive-loss function used for eps-svr, nu-svr and eps-bsvm.

prob.model

logical indicating whether to calculate the scaling parameter of the Laplacian distribution fitted on the residuals of numeric response variables. Ignored in the case of a factor response variable.

cache

cache memory in MB.

tol

tolerance of termination criterion.

shrinking

whether to use the shrinking-heuristics.

sigma

inverse kernel width used by the ANOVA, Bessel, and Laplacian kernels.

degree

degree of the ANOVA, Bessel, and polynomial kernel functions.

...

arguments passed to SVMModel from the other constructors.

order

order of the Bessel function to be used as a kernel.

scale

scaling parameter of the polynomial and hyperbolic tangent kernels as a convenient way of normalizing patterns without the need to modify the data itself.

offset

offset used in polynomial and hyperbolic tangent kernels.

Details

Response types:

factor, numeric

Automatic tuning of grid parameters:

  • SVMModel: NULL

  • SVMANOVAModel: C, degree

  • SVMBesselModel: C, order, degree

  • SVMLaplaceModel: C, sigma

  • SVMLinearModel: C

  • SVMPolyModel: C, degree, scale

  • SVMRadialModel: C, sigma

The kernel-specific constructor functions SVMANOVAModel, SVMBesselModel, SVMLaplaceModel, SVMLinearModel, SVMPolyModel, SVMRadialModel, SVMSplineModel, and SVMTanhModel are special cases of SVMModel which automatically set its kernel and kpar arguments. These are called directly in typical usage unless SVMModel is needed to specify a more general model.

Default argument values and further model details can be found in the source See Also link below.

See Also

ksvm, fit, resample

Examples

Run this code
fit(sale_amount ~ ., data = ICHomes, model = SVMRadialModel)

Run the code above in your browser using DataLab