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
0 answers

Maximum and minimum penalty in lasso regression family

I am trying to adjust penalty, lambda, in group lasso regression, but I have no idea about it. I am wondering is there any theory or rule about maximum and minimum value of lambda based on x, input, and y, response? I need an automatic procedure to…
0
votes
1 answer

Lasso after GLM

After doing a bit of logistic regression Im trying to do Lasso regression but on typing various commands I keep getting object not found errors Here is my code so far data <- read.csv("ahw.csv", + colClasses = c("factor", + …
Michael
  • 13
  • 1
  • 4
0
votes
0 answers

Predicted coefficients from LASSO cannot display the right Header of coefficients for large sample

I am running a regression using LASSO for a dataset with 102 predictors. the dataset was correctly read,and names(murder) gives me the correct Header. >library(glmnet) >murder=read.csv(file="CommViolPredUnnormalizedData.csv", header = TRUE) After…
0
votes
1 answer

Zero output for Lasso in constant curve-fitting

I want to approximate a constant function with a sum of nonlinear functions. I can do this with ordinary least squares, but with lasso something is going wrong, probably because the function to be approximated is constant. I give a toy example in…
user2118903
  • 401
  • 1
  • 4
  • 8
0
votes
1 answer

Efficient logistic regression with L1 regularization in matlab

I am searching for an efficient logistic regression implementation in matlab. I used lassoglm in matlab. But when I try with 10000 examples with 1000 features and regularization params 0.005 to 1, it is really slow. I use two fold cross validation.…
user34790
  • 2,020
  • 7
  • 30
  • 37
0
votes
1 answer

Why do I get some negative values (predictors) as output of regressor estimators (Lasso, Ridge, ElasticNet)

For my regression problem, I am using GridSearchCV of scikit-learn to get the best alpha value and using this alpha value in my estimator (Lasso, Ridge, ElasticNet). My target values in the training dataset do not contain any negative values. But…
user644745
  • 5,673
  • 9
  • 54
  • 80
0
votes
1 answer

Lasso in R package glmnet: solution not optimal?

I am just trying to understand the lasso implemented in R package glmnet. I am fitting the data but the solution I get for a lambda of my choice is not minimising the criteria of the lasso, for instance if I move the solution in one way I can get a…
-1
votes
1 answer

The difference between random states in sklearn

I am writing this to understand more about regressions in machine learning. When I set 42 for random_state, lasso seems to predict badly. But it is vice versa when I set 2. Is there any way to choose the random_state? It is just a simple and very…
-1
votes
1 answer

What is a simple to use library besides elastic net which can fit LASSO Regressions for output verification

I have run a series of LASSO Regressions in RStudio sequentially, one on each csv-formatted dataset within a file folder using the enet() function from the elastic net package in R with its lambda argument set to 0. However, as an important sanity…
-1
votes
1 answer

Lasso Regression

For the lasso (linear regression with L1 regularization) with a fixed value of λ, it is necessary to use cross–validation to select the best optimization algorithm. I know for a fact that we can use cross validation to find optimal value of λ, but…
Hardik
  • 25
  • 1
  • 6
-1
votes
1 answer

Recall is always 1 when using Lasso regardless of lambda value in R

I am trying to get the prediction accuracy, precision and recall when running Lasso logistic model but it turns out that no matter what lambda I set, the recall is always 1 (even when I set lambda = 0) Below is my code. Here I'm using Smartket…
-1
votes
1 answer

R^2 is negative when I split train and test set in Lasso Regression

I tried running the Lasso Regression with Crude oil price, I can't shuffle the train and test set when I split into train and test set Crude Oil Price in 2020, it's very strange because of COVID-19 But I want to know how to fix the error on train…
-1
votes
1 answer

Mean Square Error(MSE) in Lasso and Ridge Regressions in Python

I am actually coding Ridge and LASSO regressions at the same time for one dataset, and at the end I am trying to plot the graphs of performance as well as the Errors (MSE) for both methods. For the performance, I used the commands…
-1
votes
1 answer

Why should we use Lasso over Linear regression for feature selection in machine learning?

while selecting features in machine learning, one can use Lasso regression to figure out the least required feature by selecting the least coefficient but we can do the same using Linear Regression linear regression Y=x0+x1b1+x2b2.......xnbn here…
-1
votes
1 answer

Lasso and Ridge Regression Low-Accuracy Problem

I apply lasso regression and ridge regression on my forest fire sample dataset however my accuracy is too much low that I should achive I have already tried to change the alpha and train set values #Kütüphaneleri importladım import pandas as…
1 2 3
30
31