You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: summary specific information for penalized #5461
PenalizedMixin subclasses use the inherited summary which does not contain any information about the penalization besides the model name.
When reading the summary in a notebook it would be useful to see which penalization type or class has been used and what the penalization weights are.
Maybe extra option: allow dropping some parameters from the summary table, e.g. those corresponding to large spline/polynomial basis functions or those thresholded to zero. (There is a github issue for dropping extra categorical fixed effects from the summary, IIRC.)
We should be able to add some extra information to the inherited method, i.e. without copying the super summary method, which would be model dependent.
possibilities
use extra attributes in top table, e.g. super summary checks for a dict, _summary_extra and appends it
add a 3rd (or 4th) table at bottom
add to extra string (which contains warnings in OLS/WLS)
write a separate summary_penalization method that provides an extra table or text with more info about the penalization. (e.g. we should/could also add informative __str__ and __repr__ for penalty classes which could be reused).
The problem might be similar with modifier fit_xxx methods, e.g. fit_constrained.
Nobody is currently working on this.
I haven't looked closely yet, whether we want a penalization specific part in summary, or some extra generic part. I don't know at the moment what extra info fit_constrained and similar would need in the summary.
I opened this issue mainly as a user. Going back to some notebooks that I wrote a month or two ago, I am missing this information, spline basis function and penalization in the GAM case, to quickly figure out from the summary table which model was estimated.
Thinking about the spline basis again, I think I could change the created params_names or exog_names to include the spline type code e.g. bs for bsplines, cc for cyclic regression splines.
I've had an initial read through some of the code. My initial thoughts are to alter the summary class to collect the penalization information from the model class and then append this to the bottom of the summary, similar to your first point in your initial comment.
The summary class should not "know" anything about penalization, but should just process generic "extra information", that could be specified by the specific results classes, e.g. in summary before calling super(...).summary.
The summary module could get any needed additional helper functions or methods for formatting and presenting the results.
Activity
stevenbw commentedon Jan 20, 2019
Is anyone working on this @josef-pkt? If not, I would like to take a look at this.
josef-pkt commentedon Jan 20, 2019
Nobody is currently working on this.
I haven't looked closely yet, whether we want a penalization specific part in summary, or some extra generic part. I don't know at the moment what extra info fit_constrained and similar would need in the summary.
I'm still working on GAM PR #5370, but didn't plan to work on this before merging it, which should happen in the next few days.
e.g. my latest gist https://gist.github.com/josef-pkt/2f78444b9e71294e0cd33f48fdc89a5e
shows the formula support and the
summaryof the results.I opened this issue mainly as a user. Going back to some notebooks that I wrote a month or two ago, I am missing this information, spline basis function and penalization in the GAM case, to quickly figure out from the summary table which model was estimated.
Thinking about the spline basis again, I think I could change the created params_names or exog_names to include the spline type code e.g. bs for bsplines, cc for cyclic regression splines.
stevenbw commentedon Jan 22, 2019
I've had an initial read through some of the code. My initial thoughts are to alter the
summaryclass to collect the penalization information from the model class and then append this to the bottom of the summary, similar to your first point in your initial comment.josef-pkt commentedon Jan 22, 2019
The summary class should not "know" anything about penalization, but should just process generic "extra information", that could be specified by the specific results classes, e.g. in summary before calling super(...).summary.
The summary module could get any needed additional helper functions or methods for formatting and presenting the results.
stevenbw commentedon Jan 24, 2019
Yes - the fit_regularized() or fit() method will know the extra information. The summary class can be edited to display it correctly.
ENH: Add penalization summary, closes statsmodels#5461
ENH: Add penalization summary, closes statsmodels#5461