Questions tagged [glmnet]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Prediction interval for Poisson Elasticnet GLM

Is it possible to derive prediction intervals for a penalized Poisson generalized linear model ? I am interested in predicting future death rates of a given population. I use the standard Poisson ...
1
vote
0answers
34 views

Why would one want to choose lambda.1se for ridge regression in glmnet?

In R, choosing lambda.1se over lambda.min to get a more parsimonious model is common. This post (and this) also indicated that ...
1
vote
0answers
12 views

BIC-Lasso Shrinkage

I am currently reviewing the below paper and was wondering if it was possible to correctly implement the BIC equation for "BIC-LASSO Shrinkage". This doesn't appear to be the same as the typical BIC ...
1
vote
2answers
34 views

glmnet foldid for time series data

I'm currently working with cv.glmnet and it is my understanding that you should not use normal cross validation for time series data. Is it possible to use the foldid argument with cv.glmnet in order ...
1
vote
1answer
43 views

One standard error rule in repeated K fold?

I’m confused by using one standard error rule in repeated k fold scenario. In k fold cross validation, the standard error is of the error metrics is calculated as: ...
0
votes
0answers
40 views

cv.glmnet with Time Series Data

I'm not sure if this has been asked but I can't seem to find anything regarding the question. Is it possible to use cv.glmnet for time series data? I currently have a blocked time series data frame ...
0
votes
0answers
32 views

Variable selection for Autoregressive Distributed Lag model

I want to create an ADL model on a basis of data set with 20 original variables with 4 different lags for each one of them. Moreover, I'm interested in some interaction effects between predictors. I ...
3
votes
2answers
61 views

glmnet for binary outcomes: Why is “%Dev” inversely correlated with lambda?

I am new to glmnet but would like to apply it to a dataset with binary outcomes. Can you please clarify a few questions for me? Below are the codes and data setup <...
0
votes
1answer
41 views
+50

How should I consider the signs of the beta weights in a composite?

I have some biomarkers ($X_1, \ldots, X_5$) and I want to model an outcome ($Y$) using these biomarkers. The biomarkers are correlated. So I decided to use a ridge regression to stabilize the ...
1
vote
0answers
39 views

Logistic regression in R - understanding function outputs

I'm looking to gain more understanding on how to properly perform logistic regression using R. I have a matrix x with 20 features (columns) and 1000 samples (rows) and a response vector y with values ...
3
votes
0answers
40 views

Different coefficient estimates from ncvreg and glmnet in logistic regression

I'm trying to compare the results from glmnet and ncvreg in logistic regression. The methods have similar coefficients estimates ...
1
vote
1answer
31 views

Meaning of “deviance” when using glmnet and family = “binomial”

When using glmnet in R with family = "binomial" you can set type.measure = "class" or ...
4
votes
0answers
52 views

Results of cv.glmnet in R versus RidgeCV in scikit-learn

I'm having trouble reconciling different values for the ridge parameter that minimizes mean squared error when using RidgeCV in scikit-learn (Python) and cv.glmnet (R). First a few things to note: ...
0
votes
0answers
14 views

glmnet computation time differences - Why?

glmnet seems to slow down in an application I'm doing (Joint Lasso) if one parameter increases. I figured out that the matrix I am giving to glmnet increases in its second half. It is comparable to ...
0
votes
0answers
12 views

Intercept submodel in logistic regression

I am working with a large worker safety data set with the goal of building a scorecard that is easy for business professionals to understand and work with. The data contains worker safety performance ...
1
vote
0answers
14 views

glmnet mgaussian lambda in r [closed]

I have built a multi-response regression model using glmnet package in r. I find there are two ways to extract lambda used in the training process. ...
1
vote
0answers
13 views

Glmnet R - can't modify fdev parameter when lower = 0 [closed]

I want to solve the following optimisation problem $\hat{\beta} = \arg \min_{\beta \geq 0} \| y- A\beta\|_2^2 + \lambda \|\beta\|_1$ For that, I am using glmnet package (cv.glmnet for finding $\...
2
votes
2answers
97 views

Combining results of multiple Lasso runs / Variable selection

I would appreciate your opinion on an analysis approach I have in mind. The idea is to do the variable selection with multiple runs of Lasso regression (by glmnet in R). Basically, the workflow would ...
3
votes
1answer
44 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. ...
0
votes
0answers
17 views

What is considered as a good fit using the fraction deviance?

I am using the fraction deviance given by Hastie et. al (2015), $\mathcal{D}_{\lambda}^{2}=\frac{\mathcal{D}\mathrm{ev}_{\mathrm{null}}-\mathcal{D}\mathrm{ev}_{\lambda}}{\mathcal{D}\mathrm{ev}_{\...
0
votes
1answer
20 views

Selected variables varies depending on whether or not standardization is in lasso regression (glmnet)

The paper often suggests both standardized and unstandardized coefficients in the lasso model (glmnet in R). However, when I run glmnet, the selected variable is different depending on standardized =...
1
vote
1answer
38 views

High odds ratio for composite score created by ridge regression

This question is a follow up to one of my previous questions asked on this site. The goal was to create a composite score for biomarkers related to a binary outcome and then use that in a regression ...
0
votes
0answers
20 views

Working Response variable and Weights for Logistic Regression (glmnet)

I am trying to figure out how the intercept is calculated for logistic regression lasso using coordinate descent algorithm based on this seminal paper: https://www.ncbi.nlm.nih.gov/pmc/articles/...
2
votes
0answers
80 views

Checking non linear effects in LASSO regression

This might be a weird question and I understand that LASSO is mainly using as a variable selection method. But I want to know that is it possible to check non-linear effects of a LASSO logistic ...
3
votes
0answers
43 views

Why does LASSO predict random data “well” during leave-one-out cross validation?

pre-amble: While investigating different cross validation strategies for small sample size dataset's with relatively large number of features I came across this peculiar result. While making a simple ...
5
votes
1answer
208 views

How to interpret coefficients of a multinomial elastic net (glmnet) regression

I'm trying to model a membership in one of three well-being clusters (flourisher, normative, languisher) based on a set of predictors, using elastic net for both variable selection & modelling. I ...
0
votes
0answers
36 views

Log Likelihood Glmnet

I am not exactly sure if I understood the glmnet algorithm correctly (https://web.stanford.edu/~hastie/glmnet/glmnet_alpha.html). It says it uses a maximum likelihood approach to find a solution. ...
2
votes
1answer
112 views

Why standardization of design matrix $X$ with factor $\frac{1}{n}$ instead of $\frac{1}{n-1}$ in lasso/glmnet?

I'm a little bit puzzled by the default standardization of the lasso/elastic net/ridge regression algorithms implemented in the (great!) glmnet package. In most other applications, people would ...
0
votes
1answer
36 views

Logistic Regression in MATLAB glmnet always returns 0 vector as coefficients [closed]

I am using glmnet in MATLAB 2019a on my Macbook to do logistic regression. Algorithm: $log(\frac{\pi_i}{1-\pi_i})=\beta_0+X_i^T\beta$ $\pi_i=P(Y=2|X_i)=1-P(Y=1|X_i)$ Code: ...
0
votes
0answers
39 views

Shrinkage Parameter for LASSO (glmnet package in R)

I am using glmnet package in R-software to build a Binary Logistic Regression with the LASSO. I have used the following link as ...
0
votes
1answer
55 views

glmnet models comparison

I'm trying to compare several GLMs realized using glmnet function. However, I do not understand which parameter I have to consider in order to define de best model which describe the relation among ...
2
votes
0answers
26 views

Practical advice for identifying important interactions terms (with glinternet, or other approaches)

I work with scientists who supply experimental data (often that doesn't come from deliberate Design of Experiments). I am comfortable addressing the question of "which predictor variables are the ...
0
votes
1answer
118 views

R's glmnet (Standardize) vs Sci-kit Elastic Net (Normalize)

I was using Hastie's 2005 Elastic Net to fit a linear regression model with corrected penalization using a 12MM x 769 observations. I experimented in both R and Python. I was fitting the models using ...
0
votes
0answers
201 views

caret() and glmnet() give different coefficients

I have understood from this post (https://stackoverflow.com/questions/48653465/r-coefficients-from-glmnet-and-caret-are-different-for-the-same-lambda) that caret() and glmnet() may not use the same ...
3
votes
1answer
79 views

Combining many sparse binary variables

Based on kjetil b halvorsen suggestion, I rephrased my problem: My problem is analogous to the following: i am supposed to predict if a high school student will go to university (Yes/No). I have ...
0
votes
0answers
46 views

Adaptive Lasso:msgps, glmnet, or glmaag?

To perform Adaptive lasso, which is the best package: msgps, or glmnet or glmaag? What's the difference among the three packages: algorithm, results?
0
votes
0answers
24 views

robust regression in glmnet?

I have data with many errors in the input. However, I also have much more independent variables than samples. I have been using glmnet for penalized regression. Is there a good algorithm like glmnet ...
0
votes
0answers
127 views

Creating a risk score from Cox Regression

I have two datasets with palliative cancer patients including 106 and 60 patients, respectively. I have biomarkers of inflammation and coagulation, as well as clinical characteristics for all patients....
0
votes
0answers
74 views

Quadratic Approximation of the binary logistic regression

I am using https://web.stanford.edu/~hastie/Papers/glmnet.pdf package to solve my optimization problem for the Binary Logistic Regression. On page 10 it is stated that the quadratic approximation of ...
1
vote
2answers
287 views

Minimum and maximum regularization in L0 (pseudo)norm penalized regression

L0-pseudonorm penalized least squares regression (aka best subset regression) solves $\widehat{\beta}(\lambda)$ as $$\min_\beta \frac{1}{2}||y-X\beta||_2^2 +\lambda||\beta||_0.$$ where $||\beta||_0$ ...
2
votes
1answer
101 views

Can Park & Casella's Bayesian LASSO be applied to generalized linear models?

In Park & Casella's Bayesian LASSO model the LASSO is estimated through a scale mixture of normals: ...
0
votes
0answers
26 views

Solving the Binary Logistic Regression with LASSO penalty

The objective function of the Binary logistic regression with the LASSO penalty is given by, $argmin_{\beta_0,\beta}$ { $-{1}/{n}$ $\sum_{i=1}^n (Y_i({\beta_0}+{\beta^T}x_i)-log(1+exp({\beta_0}+{\...
0
votes
0answers
49 views

Specificity decreasing when new features are added to glmnet model for case/control prediction

I'm using glmnet for prediction of case/control, which I created with the function train with additional parameters for cross ...
0
votes
0answers
68 views

Should we penalize dummy variables? [duplicate]

Using glmnet we run the following regression cvfit = cv.glmnet(x,y, alpha = 0, intercept = FALSE) where $y$ is the response variable and $x$ is the input matrix....
0
votes
0answers
50 views

Plot interpretation for underfitting/overfitting - Lass cv.glmnet

I ran a logistic Lasso Regression in R using the cv.glmnet package and get the plot below. I understand that the left dotted line is lambda.min and the right dotted line is lambda.1se. I also see ...
0
votes
0answers
55 views

Lasso regression with lasso2 (l1ce) vs glmnet

I'm struggling to get the same results from a lasso regression when using glmnet as when using l1ce from the lasso2 package. I've set a specific tuning parameter value for both, and tried to set all ...
1
vote
1answer
289 views

lasso with *extended* cox regression (time-varying covariates using counting process notation)

I'm trying to find a way to build a predictive model the development of a disease. However, some of our predictors are time-varying (aka time-dependent) -- for example, the appearance of other, age-...
0
votes
0answers
87 views

LOOCV in Caret works with Glmnet and not ElasticNet

I'm a phd student learning about different machine learning and cv methods so i apologize if this is a silly question. I have a decent understanding of lasso and am using the ...
0
votes
1answer
453 views

glmnet cox regression and survival prediction

I want to use glmnet cox regression approach to predict survival from methylation data for cancer patients. But I couldn't find any proper reference except this one https://cran.r-project.org/web/...
5
votes
2answers
265 views

One-to-one correspondence between penalty parameters of equivalent formulations of penalised regression methods

Ridge, LASSO and Elastic Net are three very popular methods of penalised regressions. All of these have more than one formulations. For example, two formulations for Ridge are: minimise $\lVert Y - X ...

1 2 3 4 5 8