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
3
votes
1 answer

Lasso regression objective did not converge

Here is my code. When I run it the ridge is fine, however for the lasso I get the error message: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations. Please help. from sklearn.linear_model import…
3
votes
0 answers

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 the code below where the first half of X has the…
BB27
  • 31
  • 2
3
votes
1 answer

R biglasso results don't match hdm or glmnet

I've been experimenting with the R package 'biglasso' for high-dimensional data. However, the results I'm getting don't match the results I get for the LASSO functions from 'hdm' or 'glmnet. The documentation for biglasso is also really poor. In the…
kng229
  • 473
  • 5
  • 13
3
votes
2 answers

Can the input for "Lasso" in python contain categorical variables?

I want to perform multiple linear regression in python with lasso. I am not sure whether the input observation matrix X can contain categorical variables. I read the instructions from here: lasso in python But it is simple and not indicate the types…
emberbillow
  • 179
  • 3
  • 10
3
votes
0 answers

Prediction intervals for penalized linear regression

Background: I am running a univariate linear regression model (OLS) and outputting a prediction interval for Y_hat. The linear model mostly suits my task up to now as it provides needed interpretability, while being simple and fast. Now, however,…
3
votes
2 answers

How to generate Coefficient >0 in lasso regression or any other method?

I am running below code to generate all the coefficient positive: from sklearn.linear_model import Lasso pos = Lasso(positive=True) pos.fit(X,y) list(pos.coef_) the above code give me positive coefficient or "0" but I need all to be positive with…
3
votes
1 answer

Question regarding LASSO confidence intervals using selectiveinference package in R

I want to get the confidence intervals for LASSO regression. For this, I used the selective inference package in R. The fixedLassoInf function in this package provides the confidence intervals for lasso regression for a given value of lambda. Also,…
3
votes
1 answer

Can I inverse transform the intercept and coefficients of LASSO regression after using Robust Scaler?

Is it possible to inverse transform the intercept and coefficients in LASSO regression, after fitting the model on scaled data using Robust Scaler? I'm using LASSO regression to predict values on data that is not normalized and doesn't perform well…
Kelsey
  • 401
  • 9
  • 21
3
votes
1 answer

How to inverse transform regression predictions after pipeline?

I'm trying to figure out how to unscale my data (presumably using inverse_transform) for predictions when I'm using a pipeline. The data below is just an example. My actual data is much larger and complicated, but I'm looking to use RobustScaler (as…
3
votes
1 answer

Lasso Regression with Python: Simple Question

Assume I have a table of values: df = pd.DataFrame({'Y1':[1, 2, 3, 4, 5, 6], 'X1':[1, 2, 3, 4, 5, 6], 'X2':[1, 1, 2, 1, 1, 1], 'X3':[6, 6, 6, 5, 6, 4], 'X4':[6, 5, 4, 3, 2, 1]}) I want to make a simple Lasso regression using all of…
3
votes
0 answers

Graph Lassoalgorithm Sklearn.covariance.graph_lasso()

I am working on replicating a paper titled “Improving Mean Variance Optimization through Sparse Hedging Restriction”. The authors’ idea is to use Graphical Lasso algorithm to infuse some bias in the estimation process of the inverse of the sample…
3
votes
1 answer

Rcpp Evaluation error: subscript out of bounds

I want to use the "glasso" package in Rcpp code, and the cpp code is as follow: #include // [[Rcpp::depends(RcppArmadillo)]] using namespace Rcpp; // [[Rcpp::export]] List sec(arma::mat x,double lam){ Environment…
Xia.Song
  • 416
  • 3
  • 15
3
votes
1 answer

"get_int_parms" not available for .Fortran() for package "glmnet"

I am trying to fit a simple lasso model with the latest glmnet package. I have read in a csv-file and have all my data stored as a "list" or matrix. I tried to follow this guide for the…
Mikael
  • 31
  • 1
3
votes
0 answers

Why I get different results of shrinkage parameter lambda with glmnet and penalized?

I am studing variable selection using LASSO (least absolute shrinkage and selection operator) with Cox model, I use two R packages glmnet and penalized. I use cv.glmnet and optL1 to find the optimal shrinkage parameter $\lambda$. My question is :…
Ph.D.Student
  • 704
  • 6
  • 27
3
votes
2 answers

On how to solve for the sparse OLS - how to apply `l1` minimization in Matlab (educational purpose)

min_{a*x=y} +lambda*norm(\hat{a},1) is the objective function where a is the vector of coefficients, y denotes the noisy measurements and x is the unobserved input signal. I am aware of lasso() function but I don't prefer to use the inbuilt function…