Description Usage Arguments Value Author(s) Examples
Fit roup lasso logistic regression and returns a list object
1 |
trainx |
a data frame where samples are in rows and features are in columns |
trainy |
a numeric or factor vector containing the outcome for each sample |
lambda |
value of tuning parameter lambda |
A grplasso
object is returned, for which coef
, print
, plot
and predict
methods exist.
Hui Lin, longqiman@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
data("sim1_da1")
trainx = dplyr::select(sim1_da1, -y)
trainy = sim1_da1$y
# index of the group
index <- gsub("\\..*", "", names(trainx))
# nlam is the number of values of tuning variable
nlam <- 20
# type of prediction
type = "link"
# number of cross-validation folds
kfold <- 10
cv_fit <- cv_glasso(trainx, trainy, nlam = nlam, kfold = kfold)
str(cv_fit)
fitgl <- fitglasso(trainx = trainx, trainy= trainy, lambda = cv_fit$lambda.max.auc[1])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.