bbalasub1 / glmnet_python

GNU General Public License v3.0
199 stars 93 forks source link

ValueError: could not broadcast input array from shape (7526,1) into shape (7526) #28

Closed z2e2 closed 5 years ago

z2e2 commented 6 years ago

I am doing multinomial lasso. I am not sure what causes this issue:

Traceback (most recent call last): File "1_lasso.py", line 32, in cvfit = cvglmnet(x = x.copy(), y = y.copy(), family = 'multinomial', ptype = 'class') File "/home/zz374/anaconda3/lib/python3.6/site-packages/glmnet_python-0.2.0-py3.6.egg/glmnet_python/cvglmnet.py", line 296, in cvglmnet , foldid, ptype, grouped, keep) File "/home/zz374/anaconda3/lib/python3.6/site-packages/glmnet_python-0.2.0-py3.6.egg/glmnet_python/cvmultnet.py", line 80, in cvmultnet classid[:, i] = glmnet_softmax(predmat[:,:,i]) ValueError: could not broadcast input array from shape (7526,1) into shape (7526)

Thanks for your help.

bbalasub1 commented 5 years ago

The example in the vignette works. So this seems to be problem specific.