Skip to main content
Filter by
Sorted by
Tagged with
2 votes
0 answers
55 views

There are many ways to implement an adaptive lasso model. One of them would be to: Solve an unpenalized regression model and extract the betas Define w=1/abs(beta) Use these weights in an adaptive ...
Álvaro Méndez Civieta's user avatar
1 vote
0 answers
77 views

I am trying to simulate a LASSO estimator for approximately 10,000 repetitions and naturally thought that parallel computing would significantly speed up the process. However, when I tested a simple ...
Mondayisgood's user avatar
3 votes
0 answers
58 views

I trid to implement the coordinate descent algorithm for the Lasso Regression (in R) following this post. The only difference is the scaling of the cost function by 1/n according to my text book here ...
UeberQ's user avatar
  • 31
-1 votes
1 answer
85 views

I am trying to implement Ridge regression but I feel like I am missing something with the Python operators. Here is my code: import numpy as np x = np.random.rand(10, 2) y = np.random.rand(10, 1) ...
Melvin Curraj's user avatar
1 vote
1 answer
147 views

I'm trying to follow along to one of Julia Silge's blog posts about lasso regression using tidymodels however I am getting stuck when trying to get access to the coefficients. I wish to plot something ...
TheGoat's user avatar
  • 2,917
0 votes
0 answers
238 views

Here is some basic code generating a regression problem. import numpy as np import pandas as pd from sklearn.linear_model import Lasso, LinearRegression n = 100 np.random.seed(42) X = np.random....
Mateusz's user avatar
  • 37
1 vote
0 answers
92 views

ive been running multiple imputation on a dataset using the mice package creating 5 mids objects. Using those objects ive performed variable selection using the cv.galasso function from the miselect ...
intern5's user avatar
  • 19
0 votes
1 answer
117 views

I'm exploring a dataset with the goal to find any interesting relationships (there are a bunch of variables of interest and I want to see which features or feature combinations predict them). As a ...
querent's user avatar
0 votes
1 answer
100 views

To my Understanding standardisation is used for robustness. However, I'm having difficulty in understanding how to apply standardisation to my data in a LASSO and KNN Regression in the cv.glmnet and ...
SCZZI's user avatar
  • 13
0 votes
1 answer
174 views

There are two posts related to this topic in R language including fixed regressor in a Lasso regression model and fixed effect Lasso logit model I am writing a feature selection model using Lasso ...
ORSpecialist's user avatar
1 vote
1 answer
124 views

After the LASSO regression is constructed, plot(fit) can be employed to plot the LASSO graph. But I want to redraw this graph using ggplot and beautify it. I use the following code to redraw it, but ...
dbcoffee's user avatar
  • 317
0 votes
1 answer
306 views

I am little bit crazy trying to run a penalized cox ph regression model with functions of rms package. I’ve done it with glmnet package but I would like to analize the outputs with rms and Hmisc ...
sinectica's user avatar
0 votes
1 answer
100 views

This question is perhaps in an uncanny valley between CrossValidated and StackOverflow, as I'm trying to understand the methodology of functions in an R package, in the context of executing them ...
purpleblade98's user avatar
1 vote
0 answers
109 views

I work in a team where everyone uses Stata, and I work in R. I have created an efficient workflow that allows me to export the results quickly. The problem I ran into was when implementing the double ...
Paula's user avatar
  • 701
1 vote
1 answer
424 views

When setting l1_ratio = 0, the elastic net reduces to Ridge regression. However, I am unable to match the results obtained from sklearn's ridgeCV versus ElasticNetCV. They appear to produce very ...
Markus Loecher's user avatar
1 vote
0 answers
411 views

I would like to run logistic regression in statsmodels using an l1 penalty (lasso) and class weights due to a class imbalance. There are several posts that explain how to either implement logistic ...
makemyDNA's user avatar
2 votes
1 answer
218 views

I currently have a simple coordinate descent algorithm to solve LASSO in python: def lasso_nb(X, y, alpha, tol=0.001, maxiter=10000): n, p = X.shape beta = np.zeros(p) R = y.copy() ...
Tylerr's user avatar
  • 173
0 votes
0 answers
148 views

I was trying to replicate Julia Silge's great lesson on Lasso regression using tidymodel but even if the data cleaning gives exactly the same result, I have found that the same coding for the ...
Logos's user avatar
  • 197
1 vote
1 answer
108 views

I'm trying to reproduce the plot of the experiment in the paper "Group Lasso with Overlap and Graph Lasso - Jacob, Obozinksi and Vert". I was able to produce the data but I don't know where ...
scamilatone's user avatar
-1 votes
1 answer
134 views

I was in the process of analysis of a dataset related to property sales using r-studio and what I tried to do was develop a model. all was smooth but this code lm_model <- lm(`SALE PRICE` ~ ., ...
Inokaj's user avatar
  • 1
0 votes
1 answer
442 views

I'm trying to fit an adaptive lasso for a multinomial logit regression with glmnet. My problem is the following: when I try to use the penalty matrix (a 2x3 matrix) penalty.factor in cv.glmnet I get ...
Mauricio's user avatar
1 vote
1 answer
408 views

I am working on an academic project where the aim is to understand which features predict a binary outcome. I have therefore used a logistic model. However, there is a problem with colinearity as ...
SeanC's user avatar
  • 37
1 vote
1 answer
85 views

any help with the following is really appreciated!! My goal: I need to run a lasso model for variable selection for my data (which is in sf polygon format). My data: As said above, is a sf object. ...
Adriana Castillo Castillo's user avatar
1 vote
1 answer
166 views

I'm trying to run a lasso model for spatial (polygons) data in R. It has been very very difficult to find a package that allows me to do run the spatial lasso model and at the same time allows me to ...
Adriana Castillo Castillo's user avatar
-1 votes
1 answer
65 views

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 ...
nnguyenquy's user avatar
1 vote
0 answers
129 views

import os import pandas as pd from sklearn.linear_model import ElasticNet from sklearn.model_selection import train_test_split, GridSearchCV, cross_validate from sklearn.metrics import ...
Toiba's user avatar
  • 11
0 votes
1 answer
83 views

Here is a link to the GitHub Repository for this project. I wrote R scripts that iteratively estimate N LASSO on each of N randomly generated synthetic datasets within a file folder because LASSO is ...
Marlen's user avatar
  • 173
3 votes
0 answers
144 views

I have seen the method of calculating marginal effect for glm, gam and polr packages, but how to calculate marginal effect for lasso regression, such as glmnet packages? Is it extracting the ...
jiyuan min's user avatar
1 vote
0 answers
114 views

Not sure if this is a question for Cross Validated or Stackoverflow, will try both. I am running a LASSO using glmnet. I have panel data. I first run cv.glmnet() to select the best lambda, then I run ...
giocek's user avatar
  • 383
1 vote
1 answer
637 views

I have the following model: from statsmodels.formula.api import glm modelSpecification = glm( formula="wage ~ workhours + gender", data=train, ...
Xtiaan's user avatar
  • 296
0 votes
1 answer
107 views

Here is my code: library(leaps) library(glmnet) set.seed(7) x <- runif(100,0,1) y <- 1 + 2*x^2 + 4*x^3 + x^4 + rnorm(100,0,1) data_1<- data.frame(x,y) xridge<- model.matrix(y~x+I(x^2)+I(x^...
stupidperson's user avatar
0 votes
0 answers
215 views

I’m trying to replicate some basic linear regression results from sci-kit learn’s LASSO implementation into various pyTorch linear and non-linear models (dense & LSTM) and finding that the ...
DrJubbs's user avatar
  • 21
0 votes
1 answer
331 views

I'm trying to use the glmmLasso pacakage and am able to run a model and get a summary output and extract the fitted values, but I'm wondering if/how I can make predictions with it? Am I missing a step?...
Jeff's user avatar
  • 57
0 votes
1 answer
111 views

In an attempt to implement the HMLasso (Lasso with High missing rate, see https://www.ijcai.org/proceedings/2019/0491.pdf) in Python, I wanted to use Cvxpy. However, I've been facing an exception that ...
Noomkwah's user avatar
  • 133
2 votes
1 answer
327 views

I am writing a tidymodels engine to fit the joint LASSO described here and implemented in the fuser package. This is a LASSO model for regression that allows partial sharing of information between ...
alan ocallaghan's user avatar
1 vote
0 answers
193 views

I am trying to do a lasso regression for a binary classification task in mlr3 using the learner lrn("classif.cv_glmnet"). My goal is to train this learner on the final task and access the ...
Hanna's user avatar
  • 39
0 votes
0 answers
64 views

I want to fit the model using l1 regularized logistic regression. The response is -1, or 1, instead of 0 or 1. I am trying to reproduce the simulation of High-dimensional Ising model selection using ...
SKK's user avatar
  • 1
0 votes
1 answer
58 views

I have run N individual LASSO Regressions on N different data sets using the glmnet() function from the package of the same name in RStudio using the following lines of code: # This function fits all ...
Marlen's user avatar
  • 173
0 votes
1 answer
70 views

My code used to fit k LASSO Regressions on k csv file-formatted data sets via the enet() function from the following: set.seed(150) system.time(LASSO <- lapply(datasets, function(J) ...
Marlen's user avatar
  • 173
1 vote
1 answer
405 views

The scripts which are referenced and from which the lines of code included came from can all be found at my GitHub Repository for this project, along with mini practice datasets (called ten, top 50, ...
Marlen's user avatar
  • 173
1 vote
1 answer
269 views

I have a linear mixed effects model and I am trying to do variable selection. The model is testing the level of forest degradation in 1000 sampled points. Most points have no degradation, and so the ...
Matt Marcus's user avatar
1 vote
1 answer
297 views

I need to train a LASSO model using sklearn. I am given a pair of specifically designed training and validation datasets. The goal is to let the algorithm autogenerate a sequence of alphas (the L1 ...
user2961927's user avatar
  • 1,820
0 votes
1 answer
283 views

I want to build a regression model with a dataset that contains Holiday days such as , ,"Christmas","New year","17th of May - National day","Easter","Kr. ...
homa taha's user avatar
  • 309
0 votes
1 answer
91 views

Note: This is a follow up to a previous question I have asked here on SO which received an answer that runs, but generates incorrect output. So, this question will incorporate the proposed answer to ...
Marlen's user avatar
  • 173
0 votes
1 answer
41 views

Good evening to all, I am trying to implement for the first time LassoCV with sklearn. My code is as follows: numeric_features = ['AGE_2019', 'Inhabitants'] categorical_features = ['familty_type','...
Gaspard_Boyer's user avatar
1 vote
1 answer
217 views

I have successfully run LASSO Regressions on each of n data sets within the 'datasets' list in my R Environment/Workspace using the enet function from the elastic net library in R, but just to ensure ...
Marlen's user avatar
  • 173
0 votes
1 answer
221 views

I am running 40 LASSO Regressions sequentially on each of the 40 datasets in a list object called 'datasets' in R: datasets <- lapply(filepaths_list, fread) # change column names of all the columns ...
Marlen's user avatar
  • 173
-1 votes
1 answer
117 views

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 ...
Marlen's user avatar
  • 173
0 votes
1 answer
54 views

I have a set of candidate regressors (aka Independent Variables or 'IVs') which has been selected by a LASSO Regression I just ran in the following form: True_IVs X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 ...
Marlen's user avatar
  • 173
-1 votes
1 answer
398 views

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 ...
Hardik's user avatar
  • 25

1
2 3 4 5
9