Repository navigation
ENH: Functions for summarizing multiple model fitting results. - #8328
toshiakiasakura wants to merge 3 commits into
Conversation
|
Hello @toshiakiasakura! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2022-06-29 11:01:43 UTC |
|
@toshiakiasakura I might not get around looking at this very soon. |
bashtage
left a comment
There was a problem hiding this comment.
Some changes needed. Most importantly need tests that will visit all branches.
|
|
||
| Returns | ||
| ------- | ||
| pd.DataFrame |
| Dictionary for replacing index names. | ||
| rows : array_like | ||
| Row names for multi index. | ||
|
|
There was a problem hiding this comment.
Can you add an example here
Example
-------
>>> from statsmodels.datasets import ???
>>> # more here
There was a problem hiding this comment.
I added example, but shoud I write a link to the notebook of example of this function?
| def simple_summary_col( | ||
| results, accessor=None, index=None, fill_value=None, rename_index=None, | ||
| ): | ||
| if accessor is None: |
There was a problem hiding this comment.
Can this have a docstring. Should this be private? (leading underscore)
There was a problem hiding this comment.
I added a docstring also to it.
| ------- | ||
| result | ||
| The result instance with "params_summary" attribute. | ||
| """ |
There was a problem hiding this comment.
If this is meant to be public, can you add an example here. Also a See Also section could be helpful.
There was a problem hiding this comment.
Not reflected yet.
See the following comment.
|
Currently, I'm working on your code reviews, and I happened to remember to ask you how to add attributes... import statsmodels.api as sm
import statsmodels.formula.api as smf
df = sm.datasets.anes96.load_pandas().data
res1 = smf.glm(formula="vote ~ logpopul" ,data=df, family = sm.families.Binomial()).fit()
res2 = sm.add_params_summary(res1)
print(res2.params_summary.to_string())However, when I run |
|
I'm sorry to rush you, but what's going on for this pull request? |
|
I just came back from my vacation and travelling. I will try to look at it during the next few days. API decisions are difficult and I need to try this out to see how it works. |
|
These look like very useful functions, thanks for this PR! |
NumPy's guide.
Although there is a question about how to handle multiple summaries with
summary_col.Python: Do not show dummies in statsmodels summary
However, I thought more featured functions to achieve easy functions of handling with multiple fitting results were needed, and I tried to implement simple one with just horizontal concatenations, and one version which lets a mosaic variable to control layout of outputs.
See the link below for practical usage.
https://github.com/toshiakiasakura/statsmodels/blob/summary_multi/examples/notebooks/summary_multi_usage.ipynb
If there is a further suggestion, improvement or need to open a issue, please tell me.