bbalasub1 / glmnet_python

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

Ability to import glmnet_python without loading matplotlib #7

Closed mhaseebtariq closed 7 years ago

mhaseebtariq commented 7 years ago

It is often the case that you don't need the plotting functionalities, therefore, you don't have to install matplotlib. Currently, when you import glmnet_python the plotting methods also automatically gets loaded - and if you don't have matplotlib installed, the code crashes with an ImportError. I have therefore, moved the matplotlib imports inside the relevant methods. Please keep in mind, installing matplotlib on CentOS or Ubuntu servers is not a trivial task as well.

hanfang commented 7 years ago

Hi @mhaseebtariq

Thanks for looking at this. Have you tried running glmnet with the changes? Maybe test this on a couple small data. With that I am happy to merge the pull request. Thanks.

Han

mhaseebtariq commented 7 years ago

Hi @hanfang

Thank you so much for the quick response. I did test it on a fresh CentOS installation. I was able to load the library; fit a model; and finally make some predictions. Though I still had to install gfortran first. I am confident that it's safe to merge this pull request.

Cheers, Haseeb