-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible use of sparse matrices #3
Comments
Do you mean like this? i <- c(1,3:8); j <- c(2,9,6:10); x <- 7 * (1:7)
X <- sparseMatrix(i, j, x = x)
y <- rnorm(8)
ncvreg(X, y) I agree, that should be supported directly, and will be easy to fix. In the meantime, this should suffice as a workaround: ncvreg(as.matrix(X), y) Or am I not understanding your question? |
Yes that is exactly what I meant. |
Now I'm confused. You want to pass a sparse design matrix |
I want to pass a sparse matrix to x <- matrix(c(1,2,3,4,5,6), nrow = 3, ncol = 2)
I <- Matrix::Diagonal(2)
X <- Matrix::kronecker(I,x) So |
OK, I understand now. Yes, I think this would be a nice improvement to |
I suspected it was something not so easy to fix. |
Well, if you get it working, I'd be happy to merge it in. I suspect the most time-consuming part will be rewriting the C-level code. |
Hello all - I would also like to echo that I would like to see a spare support of this method. |
Yes would be very useful - packages like glmnet and abess do support sparse covariate matrices, but would be good to have that in ncvreg too. If the package would use Rcpp and Eigen or Armadillo classes this would be a lot easier to adapt... |
Dear Patrick,
first of all thanks for this package.
Do you think it would be possible to add the support for sparse matrices (from the Matrix package)?
The text was updated successfully, but these errors were encountered: