Learn R Programming

bmrm (version 3.0)

hingeLoss: Hinge Loss function for SVM

Description

Hinge Loss function for SVM

Usage

hingeLoss(x, y, loss.weights = 1)

Arguments

x
matrix of training instances (one instance by row)
y
numeric vector of values in (-1,+1) representing the training labels for each instance in x
loss.weights
numeric vector of loss weights to incure for each instance of x in case of misprediction. Vector length should match length(y), but values are cycled if not of identical size. Default to 1 so we define a standard 0/1 loss for SVM classifier. The parameter might be useful to adapt SVM learning in case of unbalanced class distribution.

Value

a function taking one argument w and computing the loss value and the gradient at point w

References

Teo et al. A Scalable Modular Convex Solver for Regularized Risk Minimization. KDD 2007

See Also

bmrm