bmrm (version 4.1)

linearRegressionLoss: Loss functions to perform a regression

Description

Loss functions to perform a regression

Usage

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

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

quantileRegressionLoss(x, y, q = 0.5, loss.weights = 1)

epsilonInsensitiveRegressionLoss(x, y, epsilon, loss.weights = 1)

Arguments

x

matrix of training instances (one instance by row)

y

numeric vector of values representing the training labels for each instance in x

loss.weights

numeric vector of loss weights to incure for each instance of x. Vector length should match length(y), but values are cycled if not of identical size.

q

a numeric value in the range [0-1] defining quantile value to consider

epsilon

a numeric value setting tolerance of the epsilon-regression

Value

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

Functions

  • lmsRegressionLoss: Least Mean Square regression

  • ladRegressionLoss: Least Absolute Deviation regression

  • quantileRegressionLoss: Quantile Regression

  • epsilonInsensitiveRegressionLoss: epsilon-insensitive regression (Vapnik et al. 1997)

References

Teo et al. Bundle Methods for Regularized Risk Minimization JMLR 2010

See Also

nrbm

Examples

Run this code
# NOT RUN {
  x <- cbind(intercept=100,data.matrix(iris[1:2]))
  y <- iris[[3]]
  w <- nrbm(lmsRegressionLoss(x,y))
  w <- nrbm(ladRegressionLoss(x,y))
  w <- nrbm(quantileRegressionLoss(x,y,q=0.5))
  w <- nrbm(epsilonInsensitiveRegressionLoss(x,y,epsilon=1))
# }

Run the code above in your browser using DataLab