# Questions tagged [glmnet]

R package for lasso and elastic-net regularized generalized linear models.

394 questions
Filter by
Sorted by
Tagged with
22 views

### Exact way of glmnet computing best lambda

I'm doing some research and want to get the best lambda with cross validation in python. For my dataset the R! package glmnet works pretty well, but I can not find out how it's implemented. There are ...
30 views

### Using adaptive LASSO penalty for a logistic regression

So I have this code for running adaptive LASSO in R ...
13 views

### Why does the value of the penalized ridge is divided by 2 in GLMNET? [duplicate]

If you look at GLMNET Vignette, it shows that it solves for the gaussian case: But why does it divide the value of $\parallel \beta \parallel_2^2$ by 2?
9 views

### Optimizing models for paired analysis

I want to train a model to classify pre and post samples for 50 patients. The algorithm needs to discriminate ...
22 views

### Issues with logistic regression using glmnet package

I'm trying to use the glmnet package to build a logistic regression model, but I keep getting sensitivity and specificity of 1.000. My data contains two factor ...
9 views

### glmnet() variable importance interpretation using varImp() and vi_model()

I fitted a Lasso Logistic Regression model using glmnet ...
30 views

### Why (not) having an intercept term can change the sign of some coefficient in glmnet

Sorry my dataset is pretty big so that I can not post it here. I have a simple glmnet model in R coef(glmnet(Y ~ A + B+ C, data = test_data, family = "binomial", intercept = F), s=0) shows ...
8 views

### Different results after updating the code (glmnet function) [duplicate]

I wrote a code performing an elastic net regression with a 10-fold-crossvalidation. the original dataset has 190 variables and 1402 observations. The result were 70 remaining coefficients in the final ...
21 views

### How does glmnet put constraints on coefficient upper and lower bounds?

Based on glmnet documentation at https://web.stanford.edu/~hastie/glmnet/glmnet_alpha.html Coefficient upper and lower bounds These are recently added features that enhance the scope of the models. ...
22 views

### Feature selection for optimising LOOCV AUC

at the moment I am dealing with the following problem: I have a binary classification problem with low sample size (12 and 36 instances in the two classes) and large number of features (200). My ...
74 views

### Ridge coefficient estimates do not match OLS estimates when $\lambda$ = 0

I'm trying to understand why ridge regression coefficient estimates (through the glmnet package in R) do not match the ordinary least squares (OLS) estimates in the ...
138 views

### How do I compare cv.glmnet models with AIC?

I am using the glmnet package in R, and not(!) the caret package for my binary ElasticNet regression. I have come to the point ...
18 views

### ElasticNet coefficients are different for each cv.glmnet run

I am new to R and cv.glmnet. I have now tried to run my logistic model with ElasticNet instead of stepwise as people in this community suggest. But, I have troubles ...
156 views

### How do I calculate confidence intervals on an elastic net regression in R

I am performing an elastic net regression on my data n = 34, p = 46 I first built the model using the "caret" package with the cross validation method to set the optimal alpha and lambda ...
68 views

### Why glmnet 's $\lambda$ value is so small? Does it strictly implement the loss function under the hood?
I am running a glmnet fit with 1200000 samples. According to the glmnet doc, $\lambda$ value is the coefficient controlling how much the regularization term contributes to the total loss function. ...