likelet / VSOLassoBag

A variable-selection oriented LASSO bagging algorithm for biomarker development in omic-based translational research
https://likelet.github.io/VSOLassoBag/
GNU General Public License v3.0
18 stars 3 forks source link

how to get bagged lasso model? #23

Closed humanpaingeneticslab closed 4 days ago

humanpaingeneticslab commented 7 months ago

Hello,

I'm not sure how to use the results of call the 'VSOLassoBag' :-/

For example, I would like to know which genes were selected, and how to use these genes to classify new samples.

For example, can I do this:

----- call bagged lasso

jj <- VSOLassoBag( ..., post.regression=TRUE, post.LASSO=TRUE )

----- predict new samples

cv.fit <- jj[["model"]] best_lambda <- cv.fit[[ "lambda.1se" ]] pr <- predict( cv.fit, s=best_lambda, newx=..., type="response" )

----- get list of genes and their LASSO weights

cf <- coef( cv.fit, s=best_lambda )

??? Thanks!

likelet commented 5 months ago

Sorry for the late reply, Yes, the function returns a list that contains a model object, which is a fit model that could be used for the prediction. The code you use here is right for the downstream analysis.

Qi