Skip to content

Conversation

zalgo3
Copy link
Contributor

@zalgo3 zalgo3 commented Feb 21, 2019

Summary

  • Implemented Tridiagonal Matrix Algorithm in linear_model/admm.py

Related Issues/Wiki/Resources

@zalgo3 zalgo3 force-pushed the issue/46/sparse_fusedlasso branch from 73f7f90 to cb35bf8 Compare February 21, 2019 12:31
Copy link
Contributor

@kitoranaoki kitoranaoki left a 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!

def _dia_to_tridiagonal(X):
n_samples = X.shape[0]
index = 0
for offset in X.offsets:
Copy link
Contributor

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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index = index + 1
band = X.data[[one, zero, minusone], :]
return band

Copy link
Contributor

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?

@kitoranaoki kitoranaoki merged commit 1e55002 into development Mar 4, 2019
@kitoranaoki kitoranaoki deleted the issue/46/sparse_fusedlasso branch March 4, 2019 07:54
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.

2 participants