Description Usage Arguments Value References Examples
softmax loss function may be used to predict probability distributions
1 | softmaxLoss(x, y, loss.weights = 1)
|
x |
instance matrix, where x(t,) defines the features of instance t |
y |
target matrix where y(t,) is a probability distribution that should sum to 1 |
loss.weights |
numeric vector of loss weights to incure for each instance of x. Vector length should match nrow(y), but values are recycled if not of identical size. |
a function taking one argument w and computing the loss value and the gradient at point w
Teo et al. Bundle Methods for Regularized Risk Minimization JMLR 2010
1 2 3 4 5 6 | # -- Load the data
x <- cbind(intercept=100,data.matrix(iris[1:4]))
y <- model.matrix(~iris$Species+0)
w <- nrbm(softmaxLoss(x,y))
P <- predict(w,x)
table(max.col(P),iris$Species)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.