[R] Glmnet R - can't modify fdev parameter when lower = 0

2019-11-17 Thread Pierre Maho
Hi, I want to solve the following optimisation problem: [image: \hat{\beta} = \arg \min_{\beta \geq 0} \| y-A\beta \|_2^2 + \lambda \|\beta\|_1] For that, I am using glmnet package (cv.glmnet for finding 𝜆 and lower.limits = 0 to impose non-negativity). I would like to modify the fdev parameter

Re: [R] Glmnet survival cox predict

2019-11-16 Thread Amir Hadanny
Thank you, both train and test are originated from the same data object. attached the missing code: data<-read.csv("old4.csv", header=TRUE) library(imputeMissings) data<-impute(data,object = NULL ,method = "median/mode") for (i in col[13:68]) { data[i]<-lapply(data[i], factor) } for (i in col

Re: [R] Glmnet survival cox predict

2019-11-15 Thread David Winsemius
On 11/15/19 10:49 AM, Amir Hadanny wrote: Hi all, i'm trying to get the prediction probabilities for a survival elastic net. When i use try to predict using the train model on the test set, it creates an object with the number rows of the train data (6400 rows) instead of the test data (2400 ro

[R] Glmnet survival cox predict

2019-11-15 Thread Amir Hadanny
Hi all, i'm trying to get the prediction probabilities for a survival elastic net. When i use try to predict using the train model on the test set, it creates an object with the number rows of the train data (6400 rows) instead of the test data (2400 rows). I really don't understand why, and that d

Re: [R] glmnet error: no-comfortable arguments

2016-12-09 Thread David Winsemius
> On Dec 9, 2016, at 2:45 PM, Hu Xinghai wrote: > > I come across the following error training Logistic Regression model using > cv.glmnet: > >> Error in drop(y %*% rep(1, nc)) : error in evaluating the argument 'x' in >> selecting a method for function 'drop': Error in y %*% rep(1, nc) : >> no

[R] glmnet error: no-comfortable arguments

2016-12-09 Thread Hu Xinghai
I come across the following error training Logistic Regression model using cv.glmnet: > Error in drop(y %*% rep(1, nc)) : error in evaluating the argument 'x' in > selecting a method for function 'drop': Error in y %*% rep(1, nc) : > non-conformable arguments > error in evaluating the argument 'x'

Re: [R] glmnet vignette question

2016-09-17 Thread Bert Gunter
You seem to be mainly asking for help with statistical methodology, which is generally off topic for this list, which is about help with R programming. I suggest you study the references given in the vignette/package and/or post to a statistical list like stats.stackexchange.com instead. Cheers, B

Re: [R] glmnet vignette question

2016-09-17 Thread Dominik Schneider
> Is there a way to extract MSE for a lambda, e.g. lambda.1se? nevermind this specific question. it's now obvious. However my overall question stands. On Fri, Sep 16, 2016 at 10:10 AM, Dominik Schneider < dominik.schnei...@colorado.edu> wrote: > I'm doing some linear modeling and am new to the ri

[R] glmnet vignette question

2016-09-17 Thread Dominik Schneider
I'm doing some linear modeling and am new to the ridge/lasso/elasticnet procedures. In my case I have N>>p (p=15 based on variables used in past literature and some physical reasoning) so my understanding is that I should be interested in ridge regression to avoid the issue of multicollinearity of

[R] Glmnet penalty.factor with multigaussian response

2015-11-18 Thread Maria Vila CasadesĂşs
Hi all, I'm trying to use glmnet with penalty factors in a multigaussian response model. In case of the gaussian response the input for penalty factors is a vector, but I haven't figured out how can I use penalty factors with a multigaussian response, and even if it's possible. I've tried to use a

Re: [R] glmnet: converting coefficients back to original scale

2015-04-04 Thread Mark Seeto
Thanks for your reply Mehmet. I've found that the problem was that I didn't scale the lambda value. My original example did not follow the instruction not to give a single lambda value, but that in itself wasn't the problem. Example shown below. library(glmnet) library(MASS) set.seed(1) n <- 20

Re: [R] glmnet: converting coefficients back to original scale

2015-04-03 Thread Suzen, Mehmet
This is interesting, can you post your lm.ridge solution as well? I suspect in glmnet, you need to use model.matrix with intercept, that could be the reason. -m __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/m

[R] glmnet: converting coefficients back to original scale

2015-03-19 Thread Mark Seeto
Dear R-help, I'm having trouble understanding how glmnet converts its coefficient estimates back to the original scale. Here's an example with ridge regression: library(glmnet) set.seed(1) n <- 20 # sample size d <- data.

[R] glmnet estimates and Tibshirani JRSSB 1996

2014-11-17 Thread Hanck, Christoph
Dear all, I have a question that hopefully is an R question and does not simply arise from my lack of understanding of the LASSO. The code below generates two different sets of relationships between y and X, one in which both variables matter (coefficients .5 each, line 14) and one in which on

[R] glmnet, Error in apply(nz, 1, median) : dim(X) must have a positive length

2014-08-08 Thread Sheila the angel
Hello all, In glmnet package, cv.glmnet is giving error >data(iris) >df<-data.frame(iris$Sepal.Length, iris$Sepal.Width, iris$Petal.Length, iris$Petal.Width) >x<- as.matrix(df) >y<- as.numeric(iris$Species) >fit = glmnet(x, y, family = "multinomial", type.multinomial = "grouped") >plot(fit, xvar =

[R] GLMNet Question for Multinomial Data For Determining The Right Number of Questions

2014-05-08 Thread bill messina
I just started to use the Glmnet function for doing analysis of multinomial data. See the attached code for the analysis of the Fisher iris data as an example. My question is. When I want to determine the coefficients for the best lambda value, it returns more than one set of coefficents.. Which

Re: [R] GLMNET warning msg

2013-11-12 Thread Bert Gunter
It means that 10/10 = 1 < 3. It also means that what you're trying to do (fitting 10 cases to 12000 variables) is ridiculous (assuming I understand your message correctly). Cheers, Bert On Tue, Nov 12, 2013 at 1:07 PM, Kripa R wrote: > Hi I'm getting the following warning msg after ?cv.glmnet

[R] GLMNET warning msg

2013-11-12 Thread Kripa R
Hi I'm getting the following warning msg after ?cv.glmnet and I'm wondering what it means... dim(x) 10 12000; dim(y) 10; #two groups case=1 and control=0 cv.glmnet(x, y) Warning message: Option grouped=FALSE enforced in cv.glmnet, since < 3 observations per fold Thanks, .kripa

[R] glmnet lambda and number of variables

2013-09-04 Thread Charles Determan Jr
Greetings, I have recently been exploring the 'glmnet' package and subsequently cv.glmnet. The basic code as follows: model <- cv.glmnet(variables, group, family="multinomial", alpha=.5, standardize=F) I understand that cv.glmnet does k-fold cross-validation to return a value of lambda. Howeve

Re: [R] glmnet inclusion / exclusion of categorical variables

2013-08-09 Thread David Winsemius
On Aug 9, 2013, at 12:52 PM, kevin.shaney wrote: > Thanks! I tried doing the type.multinomial="grouped" argument - but it > didn't work for me. Maybe I did something wrong. I thought I understood why > it didn't work because of sparse.model.matrix recoding variables (like below > to V12 & V

Re: [R] glmnet inclusion / exclusion of categorical variables

2013-08-09 Thread kevin.shaney
Thanks! I tried doing the type.multinomial="grouped" argument - but it didn't work for me. Maybe I did something wrong. I thought I understood why it didn't work because of sparse.model.matrix recoding variables (like below to V12 & V13} makes GLMNET unable to tell that they actually came fro

Re: [R] glmnet inclusion / exclusion of categorical variables

2013-08-09 Thread David Winsemius
On Aug 9, 2013, at 6:44 AM, Kevin Shaney wrote: > > Hello - > > I have been using GLMNET of the following form to predict multinomial > logistic / class dependent variables: > > mglmnet=glmnet(xxb,yb ,alpha=ty,dfmax=dfm, > family="multinomial",standardize=FALSE) > > I am using both continuou

Re: [R] glmnet inclusion / exclusion of categorical variables

2013-08-09 Thread Steve Lianoglou
Hi, On Fri, Aug 9, 2013 at 6:44 AM, Kevin Shaney wrote: > > Hello - > > I have been using GLMNET of the following form to predict multinomial > logistic / class dependent variables: > > mglmnet=glmnet(xxb,yb ,alpha=ty,dfmax=dfm, > family="multinomial",standardize=FALSE) > > I am using both conti

[R] glmnet inclusion / exclusion of categorical variables

2013-08-09 Thread Kevin Shaney
Hello - I have been using GLMNET of the following form to predict multinomial logistic / class dependent variables: mglmnet=glmnet(xxb,yb ,alpha=ty,dfmax=dfm, family="multinomial",standardize=FALSE) I am using both continuous and categorical variables as predictors, and am using sparse.model.

Re: [R] glmnet on Autopilot

2013-07-17 Thread David Winsemius
On Jul 17, 2013, at 5:26 PM, Axel Urbiz wrote: 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 simul

[R] glmnet on Autopilot

2013-07-17 Thread Axel Urbiz
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 mo

[R] glmnet package: command meanings

2013-05-23 Thread C W
Hi List, I have a little confused when to glmnet() vs cv.glmnet(). I know that, glmnet(): gives the fit cv.glment(): does the cv after the fit I just want to get the beta coefficients after the fit, that's it! But of all the glmnet examples I've seen, the beta coefficient is obtained ONLY AFTER

[R] GLMNET AUC vs. MSE

2012-05-28 Thread Kelly Uphoff
Hello - I am using glmnet to generate a model for multiple cohorts i. For each i, I run 5 separate models, each with a different x variable. I want to compare the fit statistic for each i and x combination. When I use auc, the output is in some cases is < .5 (.49). In addition, if I compare mean

[R] glmnet object to pmml

2012-05-18 Thread Yan Jiao
Dear R users I used glmnet generating a regression model, now I need to convert it to pmml format, but I noticed pmml r package doesn't support glmnet object, has anyone find a way solving this problem? I was thinking convert glmnet object to glm object, has anyone tried it? Many thanks Yan

[R] glmnet object to pmml

2012-05-18 Thread yan
Dear R users I generated a model using glmnet, I need to convert it to pmml, but R pmml package doesn't support glmnet, has anyone come across similar problem? any idea to solve it? Many thanks YAn -- View this message in context: http://r.789695.n4.nabble.com/glmnet-object-to-pmml-tp4630493.h

[R] glmnet speed

2012-05-14 Thread yan
I'm using glmnet for logistic regression, I got a fairly sparse dataset, 20,000 samples(very imbalanced too, 5% from one group), 1500 variables,. the code have beed running for 2 hours, still waiting for result, I am doing lasso here(alpha=1), my computer is core 2 due CPU @3Ghz, 4GB ram, why it's

[R] glmnet sparse matrix error: dim specifies too large an array

2012-04-23 Thread Nathan Stephens
I'm running into an unexpected error using the glmnet and Matrix packages. I have a matrix that is 8 million rows by 100 columns with 75% of the entries being zero. When I run a vanilla glmnet logistic model on my server with 300 GB of RAM, the task completes in 20 minutes: > x # 8 million x 100

Re: [R] glmnet: obtain predictions using predict and also by extracting coefficients

2012-03-21 Thread Weidong Gu
Hi Juliet, First of all, cv.glmnet is used to estimate lambda based on cross-validation. To get a glmnet prediction, you should use glmnet function which uses all data in the training set. Second, you constructed testX using a different data set (data.test.std) from one for glmnet predict (data.te

Re: [R] glmnet: obtain predictions using predict and also by extracting coefficients

2012-03-21 Thread Juliet Hannah
Oops. Coefficients are returned on the scale of the original data. testX <- cbind(1,data.test) yhat2 <- testX %*% beta # works plot(yhat2,yhat_enet) On Wed, Mar 21, 2012 at 2:35 PM, Juliet Hannah wrote: > All, > > For my understanding, I wanted to see if I can get glmnet predictions > using

[R] glmnet: obtain predictions using predict and also by extracting coefficients

2012-03-21 Thread Juliet Hannah
All, For my understanding, I wanted to see if I can get glmnet predictions using both the predict function and also by multiplying coefficients by the variable matrix. This is not worked out. Could anyone suggest where I am going wrong? I understand that I may not have the mean/intercept correct,

Re: [R] glmnet() vs. lars()

2012-03-21 Thread Patrick Breheny
On 03/21/2012 06:30 AM, Vito Muggeo (UniPa) wrote: It appears that glmnet(), when "selecting" the covariates entering the model, skips from K covariates, say, to K+2 or K+3. Thus 2 or 3 variables are "added" at the same time and it is not possible to obtain a ranking of the covariates according t

[R] glmnet() vs. lars()

2012-03-21 Thread Vito Muggeo (UniPa)
dear all, It appears that glmnet(), when "selecting" the covariates entering the model, skips from K covariates, say, to K+2 or K+3. Thus 2 or 3 variables are "added" at the same time and it is not possible to obtain a ranking of the covariates according to their importance in the model. On t

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread Ben Bolker
On 11-10-25 01:35 PM, julien giami wrote: > The reason i use glmnet is that it makes the handling of 400,000 > observations easier to handle in terms of memory, > > I am looking on sparse matrices but i dont understand how to build > interacting using sparse matrices > If you're not familiar w

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread julien giami
The reason i use glmnet is that it makes the handling of 400,000 observations easier to handle in terms of memory, I am looking on sparse matrices but i dont understand how to build interacting using sparse matrices On Tue, Oct 25, 2011 at 12:34 PM, Marc Schwartz wrote: > > On Oct 25, 2011, at

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread Marc Schwartz
On Oct 25, 2011, at 11:16 AM, Ben Bolker wrote: > Bert Gunter gene.com> writes: > >> >> If I understand you correctly, it sounds like you need to do some reading. >> >> ?lm and ?formula tell you how to specify linear models for glm or glmnet. >> However, if you do not have sufficient statisti

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread Ben Bolker
Bert Gunter gene.com> writes: > > If I understand you correctly, it sounds like you need to do some reading. > > ?lm and ?formula tell you how to specify linear models for glm or glmnet. > However, if you do not have sufficient statistical background, It probably > will be incomprehensible, in

Re: [R] Glmnet Logistic Variable Questions

2011-10-25 Thread Bert Gunter
If I understand you correctly, it sounds like you need to do some reading. ?lm and ?formula tell you how to specify linear models for glm or glmnet. However, if you do not have sufficient statistical background, It probably will be incomprehensible, in which case you should consult your local stat

[R] Glmnet Logistic Variable Questions

2011-10-25 Thread julien giami
We are workin on building a logistic regression using 1. We are doing a logistic regression with binary outcome variable using a set of predictors that include 8 continuous and 8 category predictors 2. We are trying to implement interaction between two variables (continuous and category or just c

Re: [R] glmnet for Binary trait analysis

2011-09-21 Thread Noah
Hi Bert, You are correct. I checked the data and did find some empty values in the X matrix. Thanks for your kindly help! Noah -- View this message in context: http://r.789695.n4.nabble.com/glmnet-for-Binary-trait-analysis-tp3828547p3830581.html Sent from the R help mailing list archive at Na

Re: [R] glmnet for Binary trait analysis

2011-09-21 Thread Bert Gunter
... another possibiity, probably more likely since you read your files in from disk, is that there is a stray character of some sort (e.g. extra comma, quotation mark, period) in your data that is causing what should be numeric data to be read in as character. Check your data after you've read them

Re: [R] glmnet for Binary trait analysis

2011-09-21 Thread Bert Gunter
The man page tells you that y must be a factor. Is it? -- Bert On Tue, Sep 20, 2011 at 5:25 PM, Noah wrote: > Hello, > > I got an error message saying > > Error in lognet(x, is.sparse, ix, jx, y, weights, offset, alpha, nobs, : > NA/NaN/Inf in foreign function call (arg 5) > > when I try to an

[R] glmnet for Binary trait analysis

2011-09-20 Thread Noah
Hello, I got an error message saying Error in lognet(x, is.sparse, ix, jx, y, weights, offset, alpha, nobs, : NA/NaN/Inf in foreign function call (arg 5) when I try to analysis a binary trait using glmnet(R) by running the following code library(glmnet) Xori <- read.table("c:\\SNP.txt", s

Re: [R] Glmnet lambda value choice

2011-08-23 Thread eugen pircalabelu
n To: r-help@r-project.org Sent: Tuesday, August 23, 2011 10:45 AM Subject: [R] Glmnet lambda value choice Hi, When using the glmnet() function of the package glmnet, A series of coefficients is returned for a list of descending lambda values. I am unable to locate anything in the documentation

[R] Glmnet lambda value choice

2011-08-23 Thread Noah Silverman
Hi, When using the glmnet() function of the package glmnet, A series of coefficients is returned for a list of descending lambda values. I am unable to locate anything in the documentation that explains HOW this choice of lambda series is made. (There is documentation about how to choose my o

Re: [R] glmnet

2011-08-10 Thread Patrick Breheny
On 08/10/2011 03:00 AM, Nick Sabbe wrote: Finally, to avoid downward bias, you could run a normal glm with only the variables selected in the previous step. At the cost, of course, of introducing upward bias -- Patrick Breheny Assistant Professor Department of Biostatistics Department of S

Re: [R] glmnet

2011-08-10 Thread Nick Sabbe
ilto:r-help-bounces@r- > project.org] On Behalf Of Andra Isan > Sent: woensdag 10 augustus 2011 5:59 > To: r-help@r-project.org > Subject: [R] 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

[R] glmnet

2011-08-09 Thread Andra Isan
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

[R] GLMNET ERROR

2011-08-01 Thread Jeff Allard
Hi All, I am looking for some help figuring out what is causing an error in my attempt to fit a regularized logistic regression (specifically finding the optimal lambda value using cv.glmnet). Running the following command: RegLR_CV<-cv.glmnet(x=train.sub.clean[,-c(431)],y=as.factor(train.sub$fi

Re: [R] glmnet with binary logistic regression

2011-07-24 Thread Patrick Breheny
On 07/23/2011 11:43 AM, fongchun wrote: I was also thinking of a bootstrapping approach where I would actually run cv.glmnet say 100 times and then take the mean/median lambda across all the cv.glmnet runs. This way I generate a confidence interval for my optimal lambda I woud use in the end.

Re: [R] glmnet with binary logistic regression

2011-07-24 Thread mxkuhn
10 fold cv has high variation compared to other methods. Use repeated cv or the bootstrap instead (both of which can be used with glmnet by way of the train() function on the caret package). Max On Jul 23, 2011, at 11:43 AM, fongchun wrote: > Hi Patrick, > > Thanks for the reply. I am ref

Re: [R] glmnet with binary logistic regression

2011-07-23 Thread fongchun
Hi Patrick, Thanks for the reply. I am referring to using the cv.glmnet() function with 10-fold cross validation and letting glmnet determine the lambda sequence. The optimal lambda that it is returning fluctuates between different runs of cv.glmnet. Sometimes the model that is return deviates

Re: [R] glmnet with binary logistic regression

2011-07-23 Thread Patrick Breheny
On 07/22/2011 07:51 PM, fongchun wrote: I am using the glmnet R package to run LASSO with binary logistic regression. ... What I am finding is that this optimal lambda value fluctuates everytime I run glmnet with LASSO. > ... Does anyone know why there is such a fluctuation in the generation o

[R] glmnet with binary logistic regression

2011-07-23 Thread fongchun
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 d

[R] Glmnet Variable Questions

2011-06-23 Thread Paul Bleicher
Hi all,  I have two questions about variables in glmnet:   1. We are doing a logistic regression with binary outcome variable using a set of predictors that include continuous and binary predictors(coded 0 and 1).  If the latter are centered and standardized, they will be transformed into negative

Re: [R] glmnet package: penalty.factor option

2011-04-27 Thread Breheny, Patrick
oject.org Subject: [R] glmnet package: penalty.factor option Anyone have experience specifying the "penalty.factor" option in the "glmnet" command? I have 3 variables (out of a million genotype variables) that I want to force into the model (i.e., set penalty factor to 0), but I ca

[R] glmnet package: penalty.factor option

2011-04-27 Thread Brian H. Chen
Anyone have experience specifying the "penalty.factor" option in the "glmnet" command? I have 3 variables (out of a million genotype variables) that I want to force into the model (i.e., set penalty factor to 0), but I can't figure out how to do that. [[alternative HTML version deleted]]

Re: [R] glmnet

2011-04-13 Thread Alexander Engelhardt
Am 13.04.2011 16:58, schrieb Janina Hemmersbach: Hello, I´m trying to in install the package 'glmnet' but I get always the error massage "package ‘Matrix’ is not available". I search on you site, but I coundn´t find the package there either. Is their still a package called "Matrix"? Or how can

Re: [R] glmnet

2011-04-13 Thread Ben Bolker
Janina Hemmersbach scai.fraunhofer.de> writes: > > Hello, > I´m trying to in install the package 'glmnet' > but I get always the error massage "package ‘Matrix’ is > not available". I search on you site, but I coundn´t > find the package there either. Is their still a > package called "Matrix"?

[R] glmnet

2011-04-13 Thread Janina Hemmersbach
Hello, I´m trying to in install the package 'glmnet' but I get always the error massage "package ‘Matrix’ is not available". I search on you site, but I coundn´t find the package there either. Is their still a package called "Matrix"? Or how can I use "glmnet"? Thank You in advance. Kind regard

Re: [R] glmnet with binary predictors

2011-02-03 Thread Nick Sabbe
ent.be wink: A1.056, Coupure Links 653, 9000 Gent ring: 09/264.59.36 -- Do Not Disapprove -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of sambit rath Sent: donderdag 3 februari 2011 10:58 To: r-help@r-project.org Subject: [

[R] glmnet with binary predictors

2011-02-03 Thread sambit rath
Hi Everybody! I must start with a declaration that I am a sparse user of R. I am creating a credit scorecard using a dataset which has a variable depicting actual credit history (good/bad) and 41 other variables of yes/no type. The procedure I am asked to follow is to use a penalized logistic proc

Re: [R] glmnet - choosing the number of features

2010-07-08 Thread Steve Lianoglou
Hi Brian, On Wed, Jul 7, 2010 at 10:54 PM, Brian Tsai wrote: > Hi, > > I am trying to use the glmnet package to do some simple feature selection. >  However,  I would ideally like to be able to specify the number of features > to return (the glmnet package, as far as I can tell, only allows > spe

[R] glmnet - choosing the number of features

2010-07-07 Thread Brian Tsai
Hi, I am trying to use the glmnet package to do some simple feature selection. However, I would ideally like to be able to specify the number of features to return (the glmnet package, as far as I can tell, only allows specification of a regularization parameter, lambda, that in turn returns a m

Re: [R] glmnet strange error message

2010-06-03 Thread Dave_F
I think I have figured out the problem. The response variable has one level with only one observation -- hence when that one observation was in the test set the training data did not contain any observations from that level and so did not fit a logistic model for that level causing the somewhat cr

Re: [R] glmnet strange error message

2010-06-02 Thread Joris Meys
Could you give us the traceback? (In case you don't know, just type traceback() right after you got the error message.) I can't reproduce the error, so it gets a bit difficult to solve without having the real data. Cheers Joris On Wed, Jun 2, 2010 at 6:51 PM, Dave_F wrote: > > Hello fellow R us

[R] glmnet strange error message

2010-06-02 Thread Dave_F
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 lev

[R] glmnet in caret packge

2010-01-25 Thread Alex Roy
Dear all, I want to train my model with LASSO using caret package (glmnet). So, in glmnet, there are two parameters, alpha and lambda. How can I fix my alpha=1 to get a lasso model? con<-trainControl(method="cv",number=10) model <- train(X, y, "glmnet", metric="RMSE",tuneLength =

Re: [R] glmnet : Error in validObject(.Object) :

2008-12-17 Thread Jorge Ivan Velez
Dear Hao, It works for me. Here is my sessionInfo(): > sessionInfo() R version 2.8.0 Patched (2008-11-08 r46864) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

[R] glmnet : Error in validObject(.Object) :

2008-12-17 Thread Hao
Could any one help ? I start to learn the glmnet package. I tried with the example in the manual. x=matrix(rnorm(100*20),100,20) y=rnorm(100) fit1=glmnet(x,y) When I tried to fit the model, I received the error message: Error in validObject(.Object) : invalid class "dgCMatrix" object: row in