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
I don't want to give up summary (yet), and maybe something like summary2 will still win in the end. Merging them sounds like quite a bit of work, which I don't want to push high on my priorities for 0.6.
(Coming to a decision other than keeping status-quo might be time consuming.)
I'd love to participate in this debate, but I need to submit my final dissertation draft in a couple weeks...
Overall, my sense is that the implementation details of summary2 could likely be much improved, but that the conceptual framework is much superior to what is currently in place. In sum, create a summary class that has two types of methods:
add_* (e.g. add_df, add_dict) which takes a variety of input formats and transforms them to data frames. These methods also store a dict of settings which can be set with appropriate keywords for headers, alignments, etc.
as_* (e.g. as_txt, as_latex) which outputs appropriately.
In principle, this is completely agnostic to the types of inputs allowed or to how those will eventually be combined as outputs. The beauty is that each pieces can be improved on their own.
Right now there's a dumb function to "align" ascii tables by calculating how many spaces are needed to pad columns. This could be improved, but it works (I think).
I seem to recall making changes that made the tables look very similar between summary() and summary2(). Customizing the look shouldn't be a problem because they both use SimpleTable.
If we move away from SimpleTable at some point in the future, summary2() wouldn't need to be changed.
An intermediate step would be for me to try and replicate the current look of summary() to make sure that's not a sticking point for @josef-pkt , and then to switch around summary() and summary2() for one "important" model (with appropriate tests, of course). That would give us a bit of experience with it.
The problem and work is in the details. as_xxx are supposed to work with both summaries, otherwise it's a bug.
The other problem is in the objective, summary() has a very strict formatting, summary is a lot more flexible, but less "deterministic".
I think the two could be merged, but it takes time.
And I'm already behind in reviewing pull request, and I still want to have fun with some of my own things (robust and nonlinear models recently) plus the still required refactoring of robust covariances and post-estimation results across models.
Right now adding a summary method to a model takes me 5 to <30 minutes.
(related: adding time stamp when the fit finishes in results.__init__ will remove the main problem for adding unit tests for the summary output.)
OT: non-linear models
I'm still bailing out on nonlinear LS, lmfit covers the area for now. But I'm slowly working my way backwards through Nonlinear-RLM, nonlinear function in GMM, non-linear MLE and transformation of endog y, log and Box-Cox, or single index models. I'm just more interested in finding the common pattern across models and post-estimation results, than working my way through the NLLS details.
as_xxx are supposed to work with both summaries, otherwise it's a bug.
That's already the case. So no bug here.
The other problem is in the objective, summary() has a very strict formatting, summary is a lot more flexible, but less "deterministic".
The "flexible" part is true, but not the "deterministic" one. If you want strict formatting, you can simply construct a dataframe with the information you want in it.
Yes, for my taste the top columns are too little separated. Because it doesn't have a block structure (right aligned number/value columns) it's more difficult to quickly check the description and top results Model: MixedLM Method: REML
another one: try a OLS summary where a params is larger than a million. Kevin showed an example like that.
I would like to switch summary to use two columns for the confidence interval. The current version looks fine in text, but not so good in html.
It might be helpful to draft a pep on the wiki that lays out the case for change. It does seem like summary2 requires less coding on the model developers part though, which is my big motivation for change.
Back in the day, I invested a fair amount of time in this, and I remember being fairly convinced that this was a significant improvement.
I am severely over-committed right now, but will have time in the coming weeks to bring this to completion. I thought I had already addressed most of the issues raised, so all that would be needed would be TODO.
If there is no viable path forward for summary2 to become default, I agree with @jbrockmendel : his code should be removed.
Activity
josef-pkt commentedon Apr 8, 2014
not urgent in my opinion.
I don't want to give up
summary(yet), and maybe something likesummary2will still win in the end. Merging them sounds like quite a bit of work, which I don't want to push high on my priorities for 0.6.(Coming to a decision other than keeping status-quo might be time consuming.)
vincentarelbundock commentedon Apr 8, 2014
I'd love to participate in this debate, but I need to submit my final dissertation draft in a couple weeks...
Overall, my sense is that the implementation details of summary2 could likely be much improved, but that the conceptual framework is much superior to what is currently in place. In sum, create a summary class that has two types of methods:
In principle, this is completely agnostic to the types of inputs allowed or to how those will eventually be combined as outputs. The beauty is that each pieces can be improved on their own.
Right now there's a dumb function to "align" ascii tables by calculating how many spaces are needed to pad columns. This could be improved, but it works (I think).
I seem to recall making changes that made the tables look very similar between summary() and summary2(). Customizing the look shouldn't be a problem because they both use SimpleTable.
If we move away from SimpleTable at some point in the future, summary2() wouldn't need to be changed.
jseabold commentedon Apr 8, 2014
I assume we have a few months yet to 0.6. Just want to park this here, so we don't lose sight of it.
vincentarelbundock commentedon Apr 8, 2014
An intermediate step would be for me to try and replicate the current look of summary() to make sure that's not a sticking point for @josef-pkt , and then to switch around summary() and summary2() for one "important" model (with appropriate tests, of course). That would give us a bit of experience with it.
josef-pkt commentedon Apr 8, 2014
The problem and work is in the details.
as_xxxare supposed to work with both summaries, otherwise it's a bug.The other problem is in the objective, summary() has a very strict formatting, summary is a lot more flexible, but less "deterministic".
I think the two could be merged, but it takes time.
And I'm already behind in reviewing pull request, and I still want to have fun with some of my own things (robust and nonlinear models recently) plus the still required refactoring of robust covariances and post-estimation results across models.
Right now adding a
summarymethod to a model takes me 5 to <30 minutes.(related: adding time stamp when the fit finishes in
results.__init__will remove the main problem for adding unit tests for the summary output.)jseabold commentedon Apr 8, 2014
OT: non-linear models https://twitter.com/modernscientist/status/452975139513458688
josef-pkt commentedon Apr 8, 2014
OT: non-linear models
I'm still bailing out on nonlinear LS, lmfit covers the area for now. But I'm slowly working my way backwards through Nonlinear-RLM, nonlinear function in GMM, non-linear MLE and transformation of endog y, log and Box-Cox, or single index models. I'm just more interested in finding the common pattern across models and post-estimation results, than working my way through the NLLS details.
vincentarelbundock commentedon Apr 8, 2014
That's already the case. So no bug here.
The "flexible" part is true, but not the "deterministic" one. If you want strict formatting, you can simply construct a dataframe with the information you want in it.
josef-pkt commentedon Apr 17, 2014
Kerby is using summary2 in mixed models PR.
One thing that should be improved is right alignment of numbers in the params table
vincentarelbundock commentedon Apr 17, 2014
What about if you change this line to
align='r'?https://github.com/kshedden/statsmodels/blob/lme/statsmodels/regression/lme.py#L1680
josef-pkt commentedon Apr 17, 2014
Thanks, that's better. I didn't check whether it was set specifically in the model
vincentarelbundock commentedon Apr 17, 2014
Great. Let me know if there are other style things you'd like to see changed (e.g. spacing between columns.)
josef-pkt commentedon Apr 17, 2014
Yes, for my taste the top columns are too little separated. Because it doesn't have a block structure (right aligned number/value columns) it's more difficult to quickly check the description and top results
Model: MixedLM Method: REMLanother one: try a OLS summary where a params is larger than a million. Kevin showed an example like that.
I would like to switch
summaryto use two columns for the confidence interval. The current version looks fine in text, but not so good in html.vincentarelbundock commentedon Apr 17, 2014
OK. in
summary2the confidence intervals are already 2 columns. And the ascii printout looks pretty good even with parameters >10**8.http://nbviewer.ipython.org/gist/anonymous/11000685
jseabold commentedon May 6, 2014
It might be helpful to draft a pep on the wiki that lays out the case for change. It does seem like summary2 requires less coding on the model developers part though, which is my big motivation for change.
vincentarelbundock commentedon May 6, 2014
Here's a start. What else would you like to see in there?
http://nbviewer.ipython.org/gist/vincentarelbundock/c39c3992963b0b0643aa
jbrockmendel commentedon Sep 2, 2018
Agree with OP. This has been “experimental” for ages, and supporting both strains already-strained resources.
vincentarelbundock commentedon Sep 7, 2018
Back in the day, I invested a fair amount of time in this, and I remember being fairly convinced that this was a significant improvement.
I am severely over-committed right now, but will have time in the coming weeks to bring this to completion. I thought I had already addressed most of the issues raised, so all that would be needed would be TODO.
If there is no viable path forward for
summary2to become default, I agree with @jbrockmendel : his code should be removed.josef-pkt commentedon Sep 7, 2018
Actually, having both has worked pretty well.
There are some problems (like #1964) but overall maintenance went fine. e.g. just merged #5083
There are several models that only use
summary2because it's more flexible for non-standard cases while simpler standard cases use by defaultsummary.vincentarelbundock commentedon Sep 8, 2018
cool with me. You're the one doing the maintaining after all :)
Thanks for the quick answer!
josef-pkt commentedon Sep 8, 2018
more precisely: I'm reviewing and merging maintenance and enhancement PRs in this area which we get every once in a while.