fitglasso: Fit roup lasso logistic regression

Description Usage Arguments Value Author(s) Examples

Description

Fit roup lasso logistic regression and returns a list object

Usage

1
fitglasso(trainx, trainy, lambda, na_action = na.pass)

Arguments

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

Value

A grplasso object is returned, for which coef, print, plot and predict methods exist.

Author(s)

Hui Lin, longqiman@gmail.com

Examples

 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)

happyrabbit/DataScienceR documentation built on May 17, 2019, 2:41 p.m.