Description Usage Arguments Value Author(s) Examples
Computes the linear predictors, the estimated probabilities and the estimated classes for a new data set.
1 2 3 |
object |
an object of class msgl, produced with |
x |
a data matrix of size N_\textrm{new} \times p. |
sparse.data |
if TRUE |
... |
ignored. |
link |
the linear predictors – a list of length |
response |
the estimated probabilities – a list of length |
classes |
the estimated classes – a matrix of size N_\textrm{new} \times d with d= |
Martin Vincent
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | data(SimData)
x.1 <- x[1:50,]
x.2 <- x[51:100,]
classes.1 <- classes[1:50]
classes.2 <- classes[51:100]
lambda <- msgl::lambda(x.1, classes.1, alpha = .5, d = 50, lambda.min = 0.05)
fit <- msgl::fit(x.1, classes.1, alpha = .5, lambda = lambda)
# Predict classes of new data set x.2
res <- predict(fit, x.2)
# The error rates of the models
Err(res, classes = classes.2)
# The predicted classes for model 20
res$classes[,20]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.