Questions tagged [lasso-regression]

Lasso regression is a form of regression analysis used for variable selection and regularization. Use this tag for programming questions related to Lasso regression only. You can ask statistical questions on Cross Validated instead

457 questions
0
votes
2 answers

After Lasso: Store remaining variables as new dataframe (using R)

First of all, thank you very much for your interest and time. My question (using R): To predict the yvar, I have run a lasso regression which reduced the set of xvariables from 736 to 30. lasso.mod =glmnet(x,y,alpha=1) cv.out =cv.glmnet…
0
votes
0 answers

Coefficients and significance of lasso/ridge

I had 628 predictors after forming dummy of all categorical variables. When I ran lot many iterations traditional logistic regression iteration, I came across 15 variables that was giving me pretty good model with good ROC, recall & precision(for…
0
votes
0 answers

Error message when creating LASSO regression analysis

I want to create a regression model using the LASSO technique described by Tibshirani (1996), using the package "lars". I have 28 financial independent variables all in USD or % such as profit and profit margin and 1 dependent variables (goodwill),…
Erwin R
  • 1
  • 2
0
votes
0 answers

Best alternative for stepwise regression in R

I know that there dosens of similar questions/answers, and lots of papers. But please read till the end. Non-statisticians tend to use stepwise regressions which is strongly argued by statisticians. This is stomething that I don't understand, but I…
borgs
  • 3
  • 5
0
votes
0 answers

R : model.matrix for cv.glmnet drops rows from the dataframe

I am having an issue with creating a matrix of explanatory variables for running ridge and lasso regression using cv.glmnet. My original data frame is of dimension 1460*81 and consist of several numeric and factor variables. In order to run glmnet,…
kms
  • 1,810
  • 1
  • 41
  • 92
0
votes
1 answer

How get coefs name from glmnet in R?

I am doing lasso with glmnet in R. I have the lasso coefs out$beta Input: x1 0.5744207722 x2 -0.3575682570 x3 -0.0995794334 How can I extract the name of the variables? Desired output: x1, x2,x3 What I tried $ as.data.frame as.matrix but none of…
Jill Clover
  • 2,168
  • 7
  • 31
  • 51
0
votes
0 answers

logistic regression with 1L penalty and 10-fold crossvalidation

I'm trying to apply logistic regression with an L1-penalty on the training set. I need to use 10-fold cross-validation to find an optimal value of the penalty parameter. Can anyone tell me why I get the same results for the model with x1-x3 as for…
Xi Ling
  • 11
  • 2
0
votes
1 answer

Problems with preparing data for Lasso regression

I'm trying to take Lasso regression but I can't define well my X and Y in R. #load data >test.data<-read.spss("C:\\Users\\Inhib\\OneDrive\\documents\\dummy.sav",use.value.labels=TRUE, to.data.frame=TRUE) >test.data #testing my data, it's all there…
Gilad Sabo
  • 41
  • 1
  • 5
0
votes
0 answers

Attributes of GLMNET Library in R

I was using the glmnet package in R, and I saved my input x, as a csv file. Its dimensions are: 34 by 8.I saved the output variable y as another csv file, and its dimensions were: 34 by 1 Code: x <- read.csv("input.csv") y <-…
204
  • 433
  • 1
  • 5
  • 19
0
votes
1 answer

Why does the lasso here didn't provide me with zero coefficient?

I got the idea of implementing my version of deep feature selection is from the paper here,http://link.springer.com/chapter/10.1007%2F978-3-319-16706-0_20 The basic idea of deep feature selection according to this paper is to add a one to one…
xxx222
  • 2,980
  • 5
  • 34
  • 53
0
votes
0 answers

Determining regression equation from coefficients obtained by Lasso Logistic Regression in python?

I performed Lasso regression to first do categorical feature selection (parameter space had 900 features, they were reduced to 78 after Lasso), and then as a linear model to calculate certain response variable. I have the coefficients for the…
0
votes
0 answers

if the lasso is equivalent to linear regression with a laplace prior how can there be mass on sets with components at zero?

We are all familiar with the notion, well documented in the literature, that lasso optimization (for sake of simplicity confine attention here to the case of linear regression) loss = || y - x b ||^2 + c || b || is equivalent to the linear model…
0
votes
1 answer

How does glmnet() handle with both penalized and unpenalized covariates?

Is it possible to do a lasso model with both penalized and un-penalized covariates? That is, I want to do an estimate with Y ~ gamma * X + beta * Z, where X is a n*p penalized features and Z a n*q un-penalized covariates of continues or factor…
baidao
  • 493
  • 3
  • 10
0
votes
0 answers

Code for nested cross-validation of lasso regression

I am very new to python, and my code is a slight change of this code. Currently it is throwing the following bug (and I don't understand why): File "LassoNested.py", line 51, in lasso_regressor.fit(X_test_inner, y_test_inner), line 1071, in…
0
votes
1 answer

Comparing different models using LOOCV method

I have to compare different models (OLS, BEST SUBSET, RIDGE, LASSO, PCR and PLS) using the LOO cross Validation (the criterion of comparison is the test-MSE). Could someone explain me how to do it (possibly using an example dataset)? I need the R…
Matthew
  • 1
  • 1