Skip to content

Commit

Permalink
Merge pull request #183 from jdblischak/remove-lasso-arg-normalize
Browse files Browse the repository at this point in the history
Remove arg `normalize` from `Lasso()` (no longer exists)
  • Loading branch information
omerwe authored Mar 3, 2024
2 parents 00afe71 + 17a91c5 commit ac63a4c
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit ac63a4c

Please sign in to comment.