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

Remove arg normalize from Lasso() (no longer exists) #183

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ldsc_polyfun/jackknife.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def __init__(self, x, y, is_large_chi2=False, n_blocks=None, nn=False, separator
self.est = np.atleast_2d(nnls(x, np.array(y).T[0])[0])
else:
xtx = x.T.dot(x)
lasso = Lasso(alpha=1e-100, fit_intercept=False, normalize=False, precompute=xtx, positive=True, max_iter=10000, random_state=0)
lasso = Lasso(alpha=1e-100, fit_intercept=False, precompute=xtx, positive=True, max_iter=10000, random_state=0)
self.est = lasso.fit(x,y[:,0]).coef_.reshape((1, x.shape[1]))
else:
self.est = np.atleast_2d(np.linalg.lstsq(x, np.array(y).T[0])[0])
Expand Down Expand Up @@ -292,7 +292,7 @@ def __init__(self, x, y, is_large_chi2=False, n_blocks=None, nn=False, separator
else:
x_block = x[s[i] : s[i+1]]
xtx_noblock = xtx - x_block.T.dot(x_block)
lasso_noblock = Lasso(alpha=1e-100, fit_intercept=False, normalize=False, precompute=xtx_noblock, positive=True, max_iter=10000, random_state=0)
lasso_noblock = Lasso(alpha=1e-100, fit_intercept=False, precompute=xtx_noblock, positive=True, max_iter=10000, random_state=0)
jk_est = lasso_noblock.fit(x_noblock, y_noblock[:,0]).coef_.reshape((1, x.shape[1]))
###z = nnls(x_noblock, y_noblock[:,0])[0]
###assert np.allclose(z, jk_est[0])
Expand Down
Loading