-
Notifications
You must be signed in to change notification settings - Fork 29
#46 Issue/46/sparse Using sparse properties of parameter matrices in FusedLassoADMM #47
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
Conversation
73f7f90
to
cb35bf8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zalgo-edu Overall, it looks good to me.
Great work!
spmimage/linear_model/admm.py
Outdated
def _dia_to_tridiagonal(X): | ||
n_samples = X.shape[0] | ||
index = 0 | ||
for offset in X.offsets: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use enumerate
so that we do not need to initialize and increment index
.
@@ -77,7 +99,8 @@ def admm_path(X, y, Xy=None, alphas=None, eps=1e-3, n_alphas=100, rho=1.0, max_i | |||
return alphas, coefs, n_iters | |||
|
|||
|
|||
def _admm(X: np.ndarray, y: np.ndarray, D: np.ndarray, alpha: float, rho: float, tol: float, max_iter: int): | |||
def _admm(X: np.ndarray, y: np.ndarray, D: np.ndarray, alpha: float, | |||
rho: float, tol: float, max_iter: int, tridiagonal: bool): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer indentation like this.
https://www.python.org/dev/peps/pep-0008/#indentation
spmimage/linear_model/admm.py
Outdated
index = index + 1 | ||
band = X.data[[one, zero, minusone], :] | ||
return band | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove trailing spaces?
Summary
linear_model/admm.py
Related Issues/Wiki/Resources