Skip to content
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

Question: Generalized Elastic Net #32

Open
b-schubert opened this issue Jul 8, 2017 · 0 comments
Open

Question: Generalized Elastic Net #32

b-schubert opened this issue Jul 8, 2017 · 0 comments

Comments

@b-schubert
Copy link

Hi,

I'm trying to implement a generalized elastic net of the following form:

$L = \frac{1}{2}sum_{i=1}^N (y_i - X_i\beta)^2 + \lambda_1|\beta|_1 + \frac{\lambda_2}{2}\beta^TP\beta$

(see http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004790)

with P being PSD, and was wondering if I correctly understood the API. Here is my attempt:

import regreg.api as rr
n,m=X.shape

loss = rr.squared_error(X, y)
sparsity = rr.l1norm(m, lagrange=l1)
grouping = rr.quadratic_loss(m, Q=P, coef=l2)

problem = rr.container(loss, grouping, sparsity)
solver = rr.FISTA(problem)

Any help is greatly appreciated.

Thanks,
Benni

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

No branches or pull requests

1 participant