Dear all,
I have a question about Lasso with a high-dimensional problem, both with the standard Lasso procedure in matlab and with the wrapper of the Glmnet Library. As to the standard procedure in Matlab (which solves the problem by means of ADMM algorithm), I can always get a solution which is sometimes less accurate than that produced by the wrapper of Glmnet library in Matlab. But, when I use the wrapper, I sometimes get this exception:
Error using ==
Matrix dimensions must agree.
Error in cvglmnet (line 358)
idmin = options.lambda==CVerr.lambda_min;
Even if I explicitly declare the sequence of lambdas to be used, I still might get this exception. I have also seen that, in this case, the structure returned from the following lines code of function elnet (lines 23-24):
task = 11;
[lmu,a0,ca,ia,nin,rsq,alm,nlp,jerr] = glmnetMex(task,parm,x,y-offset,jd,vp,ne,nx,nlam,flmin,ulam,thresh,isd,weights,ka,cl,intr,maxit);
alm does not contain the sequence of lambdas required, but a vector of NaNs. What this might be due to? And what can I do to solve this problem?
Many thank for your attention and my best regards,
Jason.

댓글 수: 1

Le Zheng
Le Zheng 2020년 12월 30일
Hi Jason, I'm facing the same problem, too. Did you find a solution?

댓글을 달려면 로그인하십시오.

답변 (1개)

Albena Vassileva
Albena Vassileva 2019년 7월 9일
편집: Albena Vassileva 2019년 7월 30일

1 개 추천

EDIT: Figured it out. Or rather, "patched it".. The input should be in double precision. Still not sure exactly why it happened...
But I had it in single and was getting this error too. I can only assume it went wrong somewhere around the initialization of the lambda search, and that's why it was sometimes working.

댓글 수: 1

Le Zheng
Le Zheng 2020년 12월 29일
Hi Albena, I'm facing the same problem, too. But the error still comes out when I use cmd double to convert my data to double precision. Do you have any clues?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

질문:

2018년 4월 22일

댓글:

2020년 12월 30일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by