Description Usage Arguments Value See Also Examples
The loss function for multivariate hinge loss
1 | multivariateHingeLoss(x, y, loss.weights = 1)
|
x |
matrix of training instances (one instance by row) |
y |
logical matrix of targets: y(t,) is the vector of binary labels for x(t,) |
loss.weights |
numeric vector of loss weights to incure for each instance of x. Vector length should match nrow(x), but values are cycled if not of identical size. |
a function taking one argument w and computing the loss value and the gradient at point w
nrbm
1 2 3 4 5 6 7 8 9 | x <- cbind(intercept=100,data.matrix(iris[1:4]))
y <- model.matrix(~iris$Species+0)>0
w <- nrbm(multivariateHingeLoss(x,y),LAMBDA=1)
table(y,predict(w,x)>0,col(y))
table(
do.call(paste0,as.data.frame(y+0)),
do.call(paste0,as.data.frame((predict(w,x)>0)+0))
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.