Open corradio opened 6 years ago
I've been able to trace it back to elnet.py
where the fortran call in the sparse case returns lmu_r
18 instead of 56, which truncates the sequence of lambdau
.
In case other stumble upon the same issue, I'm now using the sklearn path generation as an alternative:
lambdau_sk = sklearn.linear_model.coordinate_descent._alpha_grid(X, y)
I am having difficulties having consistent results as the set of
lambda
values selected fromcvglmnet
is not the same when using sparse and dense matrices:lambdau
usingcvglmnet(x=X.copy(), y=y.copy(), family='gaussian', parallel=True, keep=True, standardize=False, alpha=0.999, thresh=1e-10, standardize_resp=False)
:lambdau
usingcvglmnet(x=X.todense().copy(), y=y.copy(), family='gaussian', parallel=True, keep=True, standardize=False, alpha=0.999, thresh=1e-10, standardize_resp=False)
(the only difference is that a dense matrix is used as input):I've attached matrices (numpy format) to reproduce.
Xy.zip
Note: here's how to load matrices: