Repository navigation
New PR for MICE - #2076
New PR for MICE#2076
Conversation
|
just a quick look: test coverage in this PR is considerably lower than in #1757, looks like just some smoke tests. Can the old tests be ported to this? |
|
The notebooks and plots in it look very nice. |
|
At some point we decided to pull back a bit and focus on predictive mean matching. PMM seems to work quite well and apparently is the favored choice in other packages. I thought it made sense to focus on other features like diagnostic plots rather than to continue wrestling with get_distribution. I would be happy to get some feedback on the MICE implementation and can put time into upgrading the branch as needed. I will look into improving test coverage. |
|
Hopefully @agartland can provide feedback. I can give a brief review after 0.7, but I have also several other PRs that I have kept waiting for too long. @kshedden Can you give a brief summary of the difference of this version and Franks #1757 version, especially with respect to what's in 1757 and not in here. Based on your last comment I assume that there are still things in 1757 that are not obsolete and might be ported to the new version at some point. |
There was a problem hiding this comment.
something like MICE is the wrapper class that does the full analysis, ....
IIUC, to get the contrast between the function that holds some pieces and the top class
|
missing test coverage looks mostly missing smoke tests for (*) plot methods in models or results should have I'll try to finish my review tomorrow. |
There was a problem hiding this comment.
Do we need that the class itself is an iterator?
When Skipper and I took over stats.models we removed all iterators from the classes and converted them to iteration loops inside methods. The main problem is that it is very difficult to keep track what is actually changed and where the side effects are of the iterator.
I haven't looked at a specific example yet, this is just general skepticism to possibly difficult to understand code.
|
possible bug in summary2 (bug in column label) label is for Usecase: How do we handle repeated fitting during model search, evaluating different models? Do we have to start from scratch each time to get replicable random numbers given initial seed? |
|
I don't see test coverage for pvalues and confint. We have helper test functions to test consistency with normal or t distribution (given that we had some refactoring bugs with inherited pvalues and confint in the past.) |
There was a problem hiding this comment.
Storing the entire results can become memory intensive. I've done the same in adfuller, and user feedback was that the memory consumption goes up a lot with large arrays and many imputations/results. For the combine support we would only need to store params and scale and store or accumulate cov_params.
(storing full results could be optional or users could use a callback.)
|
Stata manual says they are using t distribution with missingness dependent degrees of freedom if number of imputations is small. (They mention normal distribution for large number of imputation, but without mentioning threshold and in a quick browsing I only see t distribution params tables. Some examples show "df adjustment: large sample", but still have "p>|t|" as column header. also "Model F-test: equal FMI") |
|
to summarize: The plot methods need to be renamed to start with I'm not very happy about the iterator in MICE. (vague, because it might not be needed, and makes the class more complex than necessary.) If possible it would be better to change this before merging. All the other issues can wait for a followup
I haven't tried to understand all the details. Overall I think the structure looks very good and flexible, and I expect that we will get many opportunities to build on and extend this. Can we add any of your notebooks to the documentation notebook examples? |
|
I think I have addressed most of the critical issues. When we move it out of the sandbox we can add additional features such as warm starts and saving the random state. Updated notebooks are here: https://umich.box.com/shared/static/mv2wvdcicwl4ww1kamp8lkb7fahrnl7m.ipynb |
|
I set pdf_output = False and added a smoke test for summary. |
|
Thanks @kshedden I'll merge when travis reports back Do you have an opinion about directory name and location? My initial thought was to use one folder for treatment and imputation, but now I think we just use two directories, and we can move this into |
|
Thanks. I don't have an opinion about directory location. On Sat, Nov 14, 2015 at 1:44 PM, Josef Perktold [email protected]
|
|
Wow I am looking for a Python MICE implementation since several months, thank you so much for this work! Any idea when this will be included in statsmodels? |
|
It's in. If you have any questions or suggestions after using it email the or open an issue on github. On Sat, Nov 14, 2015 at 6:08 PM, Carsten Schwemmer <[email protected]
|
|
Nice!!! |
|
Just wanted to say thank you for this. Happy to be able to do one more thing in Python that was previously only possible in R. |
|
Note: PR #3000 is moving mice to |
Frank and I decided that I should resubmit a MICE PR from my account due to time limitations on his side.
This PR supercedes #1757. It is a substantial overhaul of the code, but still contains all the main elements as designed and implemented by Frank in his GSOC project.
Here are two notebooks that illustrate how it can be used:
[Dead links, see below for updated working links]
http://nbviewer.ipython.org/urls/umich.box.com/shared/static/dkinhqyyz374k37tdwdi.ipynb
http://nbviewer.ipython.org/urls/umich.box.com/shared/static/pt8p8tctkl10t32xo97v.ipynb
Feedback welcome and encouraged.