bbalasub1 / glmnet_python

GNU General Public License v3.0
200 stars 95 forks source link

Fix incorrect newline when assigning result in glmnetPredict.py #31

Closed marnixkoops closed 6 years ago

marnixkoops commented 6 years ago

This breaks the prediction!

bbalasub1 commented 6 years ago

I am surprised. There are numerous line splits in the code. Why would only this break it?

marnixkoops commented 6 years ago

I am not talking about the linebreak in the second line: \ , newx) ) , nbeta) which I have also removed in my PR. This indeed does not break it.

This is about the newline after result =. The actual new line breaks the code. Please take a look at merged PR #30 which changes the code to

result = 
(scipy.column_stack( (scipy.ones([newx.shape[0], 1]) \          
                              , newx) ) , nbeta)

This is not correct and breaks the predict, it needs to be either

result = (scipy.column_stack( (scipy.ones([newx.shape[0], 1]) \         
                              , newx) ) , nbeta)

Or

result = \
(scipy.column_stack( (scipy.ones([newx.shape[0], 1]) \          
                              , newx) ) , nbeta)

also I removed the linebreak in my PR because the line was not long, this was not the problem.

bbalasub1 commented 6 years ago

Thanks for the clarification. Fixed now.

marnixkoops commented 6 years ago

No worries, thanks :)