Hello! My name is Amir. I've been using GLMNet for the past couple years and I can tell you that is one of the go-to packages in industry especially in healthcare! So, I had to develop multiple helper functions to visualize the outputs and I was like why not to send a PR. Hope you guys accept it.
I have added a new .py file plotting.py. In this file, two main functions are written: coeff_path_plot and cv_score_plot. In this way, the user can run the plots by importing the functions from plotting. In addition to this, the class methods are written for both logitnet.py and elasticnet.py. So, the user can have plots by running model.plot_cv_score() or model.plot_coeff_path().
In terms of new dependency, I have added matplotlib and pandas to the dev-requirements.txt file. I did need to have pandas to figure-out if the input X is in pd.DataFrame format to use the column names for legends for plot_coeff_path module. Other than that, the pandas is not required. However, I believe it would be good if we keep it.
I have also added an example directory with two Jupyter Notebook to show how the new feature works.
I would probably need some help in testing part (one of them failed!). I appreciate it.
Hello! My name is Amir. I've been using GLMNet for the past couple years and I can tell you that is one of the go-to packages in industry especially in healthcare! So, I had to develop multiple helper functions to visualize the outputs and I was like why not to send a PR. Hope you guys accept it.
I have added a new .py file
plotting.py
. In this file, two main functions are written:coeff_path_plot
andcv_score_plot
. In this way, the user can run the plots by importing the functions from plotting. In addition to this, the class methods are written for bothlogitnet.py
andelasticnet.py
. So, the user can have plots by runningmodel.plot_cv_score()
ormodel.plot_coeff_path()
.In terms of new dependency, I have added
matplotlib
andpandas
to thedev-requirements.txt
file. I did need to havepandas
to figure-out if the inputX
is inpd.DataFrame
format to use the column names for legends forplot_coeff_path
module. Other than that, thepandas
is not required. However, I believe it would be good if we keep it.I have also added an
example
directory with twoJupyter Notebook
to show how the new feature works.I would probably need some help in testing part (one of them failed!). I appreciate it.
Here is the snapshots of the plots:
NOTE All plots are customizable.