I am working on a project where I am implementing Lasso regression in R for feature selection and my scenario is as follows.
For the minimum value of $\lambda$ most of the corresponding coefficients are zero (40 out 45 coefficients are zero). It is said that the coefficients will become zero when $\lambda$ is too high. On the contrary for me, the $\lambda$ value is very small (actually to the power of -5) i.e. I have a very small $\lambda$ value and most of the coefficients are zero.
So, I have a few questions listed below:
- Is this scenario common? Can I take any measures to prevent it?
- Is selecting by Lasso not suitable for feature selection in my scenario? If so, what are the other methods I can use?
Edit
Added R code below:
coef(cv.glmmod, s = "lambda.min")[which(coef(cv.glmmod, s = "lambda.min") != 0)]
> 6.456279e-05 3.838600e-07 1.356334e-05
colnames(Final_raw)[which(coef(cv.glmmod, s = "lambda.min") != 0)]
> "smart_1_raw" "smart_189_raw" "smart_198_raw"
plot(cv.glmmod)
best_lambda <- cv.glmmod$lambda.min
best_lambda
> 9.175735e-05
(plot(cv.glmmod$glmnet.fit))
P. S. : I have also tried Ridge and Elastic net and the results were similar as the above.
After Up sampling:
plot(model)
(plot(model$glmnet.fit)
for CV'd models) gets you this in R, not sure about Python implementations. $\endgroup$family="binomial"
for the glmnet call. Right now you're optimizing for squared error. I'm curious how changing the family would affect those graphs. $\endgroup$