dwf / glmnet-python

Wrappers of Jerome Friedman's coordinate-descent Fortran implementation of lasso/elastic net regression from the R "glmnet" package.
GNU General Public License v2.0
35 stars 25 forks source link

Elastic net paths did not uncompress the glmnet indices #9

Open wernergithub opened 9 years ago

wernergithub commented 9 years ago

Hello,

I'm new to github, so I hope I follow the correct channel. Attached a patch that solves a bug in the ElasticNet.py file. In particular, the glmnets returns compressed indices, yet these were not used. Although that doesn't matter when just plotting graphs, it does matter if we try to use the returned models as a predictor. Therefore it is necessary to decompress the coefficients before returning them.

Secondly, the ElasticNet predictor object itself was also blissfully unaware of the indices.

This patch solves these two problems With kind regards,

Werner,-