Skip to content

Conversation

lynnyi
Copy link

@lynnyi lynnyi commented Nov 9, 2017

In glmnet(x, y), allow x to be a vector instead of a matrix in order to perform univariate regression.

@emallickhossain
Copy link

I don't know if this will every get merged since this is just the CRAN mirror repo. I don't know where the active source code is stored. My guess is that Trevor has it in a private repo.

@marjoleinF
Copy link

marjoleinF commented Sep 21, 2023

If one wants to do univariate regression with glmnet, it might be easiest to just add a vector of zeros:

x <- rnorm(100)
y <- x + rnorm(100)
cv.glmnet(x = cbind(0, x), y = y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants