bmrm (version 4.1)

preferenceLoss: The loss function for Preference loss

Description

The loss function for Preference loss

Usage

preferenceLoss(x, P)

Arguments

x

matrix of training instances (one instance by row)

P

a data.frame with 3 fields (i,j,cost) that specify the cost for prefering sample j over sample i.

Value

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

References

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

See Also

nrbm

Examples

Run this code
# NOT RUN {
x <- data.matrix(iris[1:4])
P <- expand.grid(i=which(iris$Species=="virginica"),j=which(iris$Species!="virginica"))
w <- nrbm(preferenceLoss(x,P),LAMBDA=0.001,EPSILON_TOL=0.0001)
# }

Run the code above in your browser using DataLab