similar to: Feature selection via glmnet package (LASSO)

Displaying 20 results from an estimated 2000 matches similar to: "Feature selection via glmnet package (LASSO)"

2013 Jul 06
1
problem with BootCV for coxph in pec after feature selection with glmnet (lasso)
Hi, I am attempting to evaluate the prediction error of a coxph model that was built after feature selection with glmnet. In the preprocessing stage I used na.omit (dataset) to remove NAs. I reconstructed all my factor variables into binary variables with dummies (using model.matrix) I then used glmnet lasso to fit a cox model and select the best performing features. Then I fit a coxph model
2011 Mar 25
2
A question on glmnet analysis
Hi, I am trying to do logistic regression for data of 104 patients, which have one outcome (yes or no) and 15 variables (9 categorical factors [yes or no] and 6 continuous variables). Number of yes outcome is 25. Twenty-five events and 15 variables mean events per variable is much less than 10. Therefore, I tried to analyze the data with penalized regression method. I would like please some of the
2011 May 28
1
Questions regrading the lasso and glmnet
Hi all. Sorry for the long email. I have been trying to find someone local to work on this with me, without much luck. I went in to our local stats consulting service here, and the guy there told me that I already know more about model selection than he does. :-< He pointed me towards another professor that can perhaps help, but that prof is busy until mid-June, so I want to get as much
2011 Aug 10
2
glmnet
Hi All,  I have been trying to use glmnet package to do LASSO linear regression. my x data is a matrix n_row by n_col and y is a vector of size n_row corresponding to the vector data. The number of n_col is much more larger than the number of n_row. I do the following: fits = glmnet(x, y, family="multinomial")I have been following this
2011 Jul 22
4
glmnet with binary logistic regression
Hi all, I am using the glmnet R package to run LASSO with binary logistic regression. I have over 290 samples with outcome data (0 for alive, 1 for dead) and over 230 predictor variables. I currently using LASSO to reduce the number of predictor variables. I am using the cv.glmnet function to do 10-fold cross validation on a sequence of lambda values which I let glmnet determine. I then take
2011 May 01
1
Different results of coefficients by packages penalized and glmnet
Dear R users: Recently, I learn to use penalized logistic regression. Two packages (penalized and glmnet) have the function of lasso. So I write these code. However, I got different results of coef. Can someone kindly explain. # lasso using penalized library(penalized) pena.fit2<-penalized(HRLNM,penalized=~CN+NoSus,lambda1=1,model="logistic",standardize=TRUE) pena.fit2
2010 Jun 02
2
glmnet strange error message
Hello fellow R users, I have been getting a strange error message when using the cv.glmnet function in the glmnet package. I am attempting to fit a multinomial regression using the lasso. covars is a matrix with 80 rows and roughly 4000 columns, all the covariates are binary. resp is an eight level factor. I can fit the model with no errors but when I try to cross-validate after about 30 seconds
2013 Jul 17
1
glmnet on Autopilot
Dear List, I'm running simulations using the glmnet package. I need to use an 'automated' method for model selection at each iteration of the simulation. The cv.glmnet function in the same package is handy for that purpose. However, in my simulation I have p >> N, and in some cases the selected model from cv.glmet is essentially shrinking all coefficients to zero. In this case,
2023 Oct 22
1
running crossvalidation many times MSE for Lasso regression
Dear R-experts, Here below my R code with an error message. Can somebody help me to fix this error?? Really appreciate your help. Best, ############################################################ #?MSE CROSSVALIDATION Lasso regression? library(glmnet) ?
2023 Oct 23
2
running crossvalidation many times MSE for Lasso regression
For what it's worth it looks like spm2 is specifically for *spatial* predictive modeling; presumably its version of CV is doing something spatially aware. I agree that glmnet is old and reliable. One might want to use a tidymodels wrapper to create pipelines where you can more easily switch among predictive algorithms (see the `parsnip` package), but otherwise sticking to glmnet
2023 Oct 23
1
running crossvalidation many times MSE for Lasso regression
Dear R-experts, I really thank you all a lot for your responses. So, here is the error (and warning) messages at the end of my R code. Many thanks for your help. Error in UseMethod("predict") : ? no applicable method for 'predict' applied to an object of class "c('matrix', 'array', 'double', 'numeric')" > mean(unlist(lst)) [1] NA
2023 Oct 22
2
running crossvalidation many times MSE for Lasso regression
No error message shown Please include the error message so that it is not necessary to rerun your code. This might enable someone to see the problem without running the code (e.g. downloading packages, etc.) -- Bert On Sun, Oct 22, 2023 at 1:36?PM varin sacha via R-help <r-help at r-project.org> wrote: > > Dear R-experts, > > Here below my R code with an error message. Can
2023 Oct 24
1
running crossvalidation many times MSE for Lasso regression
?s 20:12 de 23/10/2023, varin sacha via R-help escreveu: > Dear R-experts, > > I really thank you all a lot for your responses. So, here is the error (and warning) messages at the end of my R code. > > Many thanks for your help. > > > Error in UseMethod("predict") : > ? no applicable method for 'predict' applied to an object of class
2012 Mar 16
0
How to interpret glmnet lasso error
I get an error when I try to use glmnet to fit a lasso model on some data. My code: > lasso <- glmnet(predictorPartitionTrainingM, targetPartitionTraining, alpha=1) The error that is returned: Error in elnet(x, is.sparse, ix, jx, y, weights, offset, type.gaussian, : NA/NaN/Inf in foreign function call (arg 5) Some potentially important details: - 50 predictor variables - 300
2013 Nov 29
1
Lasso function that can handle NA values
Hi everyone, I have a large dataset with missing values. I tried using glmnet, but it seems that it cannot handle NA values in the design matrix. I also tried lars, but I get an error too. Does anyone know of any package for computing the lasso solution which handles NA values?
2011 Jun 06
1
Lasso for k-subset regression
Dear R-users I'm trying to use lasso in lars package for subset regression, I have a large matrix of size 1000x100 and my aim is to select a subset k of the 100 variables. Is there any way in lars to fix the number k (i.e. to select the best 10 variables) library(lars) aa=lars(X,Y,type="lasso",max.steps=200) plot(aa,plottype="Cp") aa$RSS which.min(aa$RSS)
2013 Jun 11
1
Caret train with glmnet give me Error "arguments imply differing number of rows"
Hello, I'm training a set of data with Caret package using an elastic net (glmnet). Most of the time train works ok, but when the data set grows in size I get the following error: Error en { : task 1 failed - "arguments imply differing number of rows: 9, 10" and several warnings like this one: 1: In eval(expr, envir, enclos) : model fit failed for Resample01 My call to train
2009 Aug 21
1
LASSO: glmpath and cv.glmpath
Hi, perhaps you can help me to find out, how to find the best Lambda in a LASSO-model. I have a feature selection problem with 150 proteins potentially predicting Cancer or Noncancer. With a lasso model fit.glm <- glmpath(x=as.matrix(X), y=target, family="binomial") (target is 0, 1 <- Cancer non cancer, X the proteins, numerical in expression), I get following path (PICTURE
2012 May 13
1
R package dependency issues when namespace is not attached
I have always assumed that having a package in the 'Depends' field would automatically also?import?the namespace. However, it seems that in R 2.15, dependencies do not become available until the package is actually?attached?to the searchpath. Is this intended behavior? The problem appears as follows: Suppose there is a package 'Child' which?Depends, but does not explicitly
2013 Dec 07
1
combine glmnet and coxph (and survfit) with strata()
Dear All, I want to generate survival curve with cox model but I want to estimate the coefficients using glmnet. However, I also want to include a strata() term in the model. Could anyone please tell me how to have this strata() effect in the model in glmnet? I tried converting a formula with strata() to a design matrix and feeding to glmnet, but glmnet just treats the strata() term with one