1
$\begingroup$

I am trying to run glmnet for logistic regression (I have some continuos predictors which I have scaled with scale() and some categorical which I turned to dummy predictors, 27 predictors, 800 observations). I passed the data to: glmnet(x,y, family='binomial', alpha = 1, standardize = FALSE)

The primary goal was to use LASSO method for selecting predictors, but the explained deviance by the model was only about 8.3% (everywhere I saw at least 60%). Should I stop here and give it up, or should I proceed to cv.glmnet and choose the model according to cv$lambda.min / cv$lambda.1se ?

After the selection I was wondering if passing selected variable to GLM and compute ods ratios would be possible / fair ?

Thank you, Matyas

(my first post here - please be patient with me)

$\endgroup$

2 Answers 2

1
$\begingroup$

I think in general nothing speaks against using a 2-stage procedure consisting of selecting a subset of predictors using the lasso and then using that subset for unregularized regression.

The procedure is known as the Relaxed Lasso and apparently has quite nice properties (see paper).

$\endgroup$
0
$\begingroup$

Is that mean the size of input x is 800*27 ? p = 27 (predictors),n = 800(observations),

not satisfied with the condition of lasso problem(n << p)? I'm new in glmnet,too.

Anyway,you can try following code to choose lambda.min and check if the corresponding dev.ratio is more than 60%

cv.fit <- cv.glmnet(x,y, family='binomial', standardize = FALSE)
ind.lambda <- which(cv.fit$lambda == cv.fit$lambda.min)
cv.fit$glmnet.fit$dev.ratio[ind.lambda]

Hopes help!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.