Description Usage Arguments Details Value Author(s) References See Also Examples
Outputs predicted response values for new user input observations at a specified lambda values
1 | predict(obj, newX, lam=NULL, standardize=c("train","self"))
|
obj |
A fitted object of class |
newX |
A matrix of new covariates |
lam |
The indexes of lambda values to be used for prediction |
standardize |
The standardization method for |
The matrix newX should have the same number of columns as the covariate matrix used to obtain obj. The argument standardize specifies how newX should be standardized. For the choice "train", the means and variances attached to obj are used. For the choice "self", the own means and variances of newX are used.
A vector or matrix of predicted responses. Each column corresponds to a value of lambda.
Kourosh Zarringhalam and David Degras
Modified from SGL package: Noah Simon, Jerome Friedman, Trevor Hastie, and Rob Tibshirani
Maintainer: Kourosh Zarringhalam <kourosh.zarringhalam@umb.edu>
Simon, N., Friedman, J., Hastie T., and Tibshirani, R. (2011)
A Sparse-Group Lasso,
http://web.stanford.edu/~hastie/Papers/SGLpaper.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 | n = 50; p = 100; size.groups = 10
index <- ceiling(1:p / size.groups)
X = matrix(rnorm(n * p), ncol = p, nrow = n)
beta = (-2:2)
y = X[,1:5] %*% beta + 0.1*rnorm(n)
y = ifelse((exp(y) / (1 + exp(y))) > 0.5, 1, 0)
data = list(x = X, y = y)
weights = rep(1, size.groups)
Fit = creSGL(data, index, weights, type = "logit", maxit = 1000, thresh = 0.001,
min.frac = 0.05, nlam = 100, gamma = 0.8, standardize = TRUE, verbose = FALSE,
step = 1, reset = 10, alphas = 0.05, lambdas = NULL)
X.new = matrix(rnorm(n * p), ncol = p, nrow = n)
predict(Fit, X.new, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.