Repository navigation
Conversation
currently fails for issue statsmodels#2685
|
@kashif Thanks, I think it's the first time that we get a bug report as unit test. Great. First results on TravisCI. It passes on python 3.4 which I use, but fails on python 3.3 (others are not finished yet). I didn't see anything directly related to pickling instance methods in the python 3 changes/release notes. But using instance methods is a bug for us. |
|
I don't find the instance method using inspection of the instances and classes, pdb also doesn't tell. It's somewhere in results._results (unwrapped), the model pickles without problems in python 2.7 and statsmodels master from a while ago. |
|
Ok, I found the offending part if I delete this key, then it pickles without problems on python 2.7
I'm not sure what this does or why we need it. |
|
ah 🆒! having a look now too |
|
Deleting |
|
To your last traceback pickling when a model uses formulas was not supported in statsmodels-0.6.1 It is supported in master through a workaround that requires that the full original data is also pickled. Full support for pickling formulas directly is still missing in patsy. see #2469 Using the numpy array and pandas interface is supposed to be fully supported. Do you have difficult transformation, like categorical interactions, in your formula? |
|
yes so the formula a categorical feature: |
|
@kashif Handling the categorical will be a but ugly, but because it's not an interaction effect it should still be ok. You have two option with master (until patsy allows pickling)
|
|
I'm still getting this error, will spend some time trying to troubleshoot it. |
|
see my comment above about I didn't check if there is a reason to restore it after unpickling, I guessed not. |
|
However, a quick attempt at handling this more generally failed: The former passes the new test, while the latter fails with the same error as the status-quo. |
|
I prefer the first explicit version. There shouldn't be many of those ever, to need |
|
@jbrockmendel Can you take over the PR, i.e. check it out, rebase, add your changes and push to new PR? |
Agreed.
Sure. |
currently fails for issue #2685