Description Usage Arguments Value Author(s) Examples
Does k-fold cross-validation for group lasso logistic regression and returns a list object
1 2 |
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 |
nlam |
number of lambda values. The default is 100 |
type |
the type of prediction. |
kfold |
number of folds - default is 10. Although nfolds can be as large as the sample size (leave-one-out CV), it is not recommended for large datasets. The default is 10. |
na_action |
function determining what should be done with missing values when predicting new data during cross validation. The default is to predict NA. |
an object of class "cv_glasso
" is returned, which is a list with the ingredients of the cross-validation fit.
Hui Lin, longqiman@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## 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 <- 10
# 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)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.