lasso-regression Questions
3
I am running the following (truncated) code using glmnet in R
# do a lot of things to create the design matrix called x.design
> glmnet(x.design, y, thresh=1e-11)
where x.design is a n x p d...
Valonia asked 18/2, 2019 at 21:46
2
Fused Lasso (Tibshirani et al, 2005) encourages sparsity of the coefficients and also sparsity of their differences.
This is the formula for the loss function and regularization:
The first term ...
Kancler asked 17/11, 2019 at 19:39
1
Solved
I want to perform penalty selection for the LASSO algorithm and predict outcomes using tidymodels. I will use the Boston housing dataset to illustrate the problem.
library(tidymodels)
library(tidyv...
Dasyure asked 15/3, 2021 at 14:2
3
I am performing lasso regression in R using glmnet package:
fit.lasso <- glmnet(x,y)
plot(fit.lasso,xvar="lambda",label=TRUE)
Then using cross-validation:
cv.lasso=cv.glmnet(x,y)
plot(cv...
Teepee asked 30/5, 2018 at 18:0
5
Solved
The glmnet package uses a range of LASSO tuning parameters lambda scaled from the maximal lambda_max under which no predictors are selected. I want to find out how glmnet computes this lambda_max v...
Dodder asked 12/8, 2014 at 6:43
2
I'm having an issue with glmnet in that I keep getting the error message
"Error in elnet(x, is.sparse, ix, jx, y, weights, offset, type.gaussian, : NA/NaN/Inf in foreign function call (arg 5)
In ...
Gory asked 7/2, 2014 at 18:48
2
Here is my code:
library(MASS)
library(caret)
df <- Boston
set.seed(3721)
cv.10.folds <- createFolds(df$medv, k = 10)
lasso_grid <- expand.grid(fraction=c(1,0.1,0.01,0.001))
lasso <- t...
Mezzosoprano asked 23/1, 2017 at 0:47
2
Main issue: Why coefficients of Lasso regression are not shrunk to zero with minimization done by scipy.minimize?
I am trying to create Lasso model, using scipy.minimize. However, it is working onl...
Hush asked 23/6, 2020 at 10:43
1
Solved
I'm trying to analyze a high dimensional data set (31 variables, 1100 observations) through a penalized vector autoregression.
Since I'm using the techniques introduced by Diebold et. al (2019) to ...
Eruption asked 14/6, 2020 at 11:45
3
Solved
The scikit-learn package provides the functions Lasso() and LassoCV() but no option to fit a logistic function instead of a linear one...How to perform logistic lasso in python?
Horseleech asked 13/1, 2017 at 16:47
2
Solved
I'm using scikit-learn's LassoCV function. During cross-validation, what scoring metric is being used by default?
I would like cross-validation to be based on "Mean squared error regression loss"...
Tertullian asked 22/5, 2017 at 5:22
2
Solved
I am trying to conduct nested resampling with 10 CVs for the inner and 10 CVs for the outer loop using regr.cvglment. Mlr provides the code using a wrapper function (https://mlr-org.github.io/mlr/a...
Scalade asked 22/6, 2018 at 21:0
2
I've got a dataset with 1000 observations and 76 variables, about twenty of which are categorical. I want to use LASSO on this entire data set. I know that having factor variables doesn't really wo...
Nysa asked 21/10, 2017 at 17:9
4
I expect LASSO with no penalization ($\lambda=0$) to yield the same (or very similar) coefficient estimates as an OLS fit. However, I get different coefficient estimates in R putting the same data ...
Citadel asked 14/7, 2016 at 6:30
1
Solved
Does anybody know how cv.glmnet (in R's glmnet) or LassoCV (scikit-learn) chooses a sequence of regularization constants (lambdas), which they use in cross-validation? Thank you very much!
Micrococcus asked 15/5, 2014 at 18:31
2
Solved
I would love to use a linear LASSO regression within statsmodels, so to be able to use the 'formula' notation for writing the model, that would save me quite some coding time when working with many...
Machinate asked 17/4, 2017 at 7:11
3
Solved
I'm trying to reproduce the following R results in Python. In this particular case the R predictive skill is lower than the Python skill, but this is usually not the case in my experience (hence th...
Odilo asked 24/4, 2017 at 7:9
2
Solved
I am having a problem to run glmnet lasso with a wide data set. My data has N=50, but p > 49000, all factors. So to run glmnet i have to create a model.matrix, BUT i just run out of memory when i c...
Menides asked 10/6, 2013 at 20:29
0
I want to perform model selection among ~150 fixed-effect and 7 random-effect variables, on a set of 360 observations. I decided to use the Lasso procedure for mixed models, with the glmmLasso. I d...
Uncovered asked 3/11, 2016 at 19:7
1
Solved
How does glmnet in the R package 'glmnet' handle NA values?
Or can it not tolerate NA values?
Bunion asked 21/7, 2015 at 1:8
1
I need to call sklearn function on matlab.
I have heard that there are some problems in calling numpy function and sklearn is based on numpy.
Is there any guide about that?
Macon asked 5/4, 2014 at 21:25
1
Solved
I am having an hard time in getting the model estimated by the R package lars for my data.
For example I create a fake dataset x and corresponding values y like this:
x = cbind(runif(100),rnorm(1...
Turgescent asked 30/1, 2014 at 17:57
2
I am attempting to carry out lasso regression using the lars package but can not seem to get the lars bit to work. I have inputted code:
diabetes<-read.table("diabetes.txt", header=TRUE)
diabet...
Longsufferance asked 7/1, 2013 at 19:14
1
© 2022 - 2024 — McMap. All rights reserved.