-
Notifications
You must be signed in to change notification settings - Fork 6
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
lasso is not able to handle matrices instead of vectors #5
Comments
Generically, On Fri, Feb 21, 2014 at 5:59 AM, Ariel Núñez notifications@github.comwrote:
Madeleine Udell |
I used CVX in matlab and saved the matrices to a file: The sizes of A, B_cvx and X are (100,100), (100,80) and (100,80):
I still get "ERROR: BoundsError()" when I call the lasso, most likely because it is using matrices instead of vectors, is there a good way to reformulate my problem before sending to the lasso? I remember reading something about kron product, will look it up. |
I also checked that the following lasso admm implementation by Simon Lucey produced the same results in the file:
|
This package is not designed to do regression on matrices. But if you want to solve minimize |AX - B|_2^2 + |X|_1, where X and B are matrices, you can reformulate the problem as a vector problem in the following way. Let b = vcat([B[:,i] for i in size(B,2)]) be the column vector that concatenates the columns of B, and let AA = vcat([A for i in size(B,2)]) be a matrix that vertically concatenates as many copies of A as there are columns in B. Then |
Okay, I have been able to test this module against an implementation in CVX and a simple lasso, it seems the result I get is a solution to the l2 norm problem but is not sparse:
The code is here:
Data can be downloaded from: |
Also did the following from Julia:
And got the same result as matlab with CVX (best viewed directly in github):
|
Here is an example that could be added to the test suite, for my problem I need to send matrices instead of vectors to the lasso solver:
The text was updated successfully, but these errors were encountered: