Repository navigation
FIX: Allow statespace models to be pickled in Python 3.6 - #3402
Conversation
|
Fixes on Python 3.6. Probably doesn't contain enough to actually correctly run the three objects that can now be pickled since there is a lot of state. Correct method will require |
|
Pinging @ChadFulton |
005ecd7 to
429f724
Compare
|
If this fixes the tests, then that sounds great to me. |
|
Unfortunately pickling is much harder than this. Probably not worth it. |
c2ebcd9 to
3bfff02
Compare
|
I think it words correctly now. I probably copied more state that was strictly necessary since I wasn't sure what should persist across iterations and what was strictly temporary. |
0d662b9 to
6289e67
Compare
|
@ChadFulton I think this is ready. Would be helpful if you could check the variables that I save in I might make one final commit where I add the pickle tests to their own file |
6289e67 to
18c802f
Compare
e8ac27e to
6c70cad
Compare
|
closes #3401 |
6c70cad to
69047c8
Compare
69047c8 to
357f526
Compare
|
@josef-pkt as long as @ChadFulton is happy with this, then it is ready. |
Minimal patch to allow pickling. Likely is not correct in the sense that the pickled objects would not behave the same after pickling.
Add __reduce__ and __setstate__ to Statespace objects
Add __reduce__ and __setstate__ to KamlanFilter objects
Add tests that will fail ifpickling doesn't work Add reduce methods
Early version of NumPy (<= 1.7) do not preserve matrix order with copying or pickling
Add tests the check that pickled models behave identically to originals
357f526 to
e02d40d
Compare
|
Thanks, merging, |
|
Hi I am using python 3.6 and trying to pickle and get the error: This is how I am doing it: Any ideas as to what I can do to fix this? Thanks, Any help is much appreciated! |
|
You need to use master.
…On Thu, Mar 22, 2018, 6:23 PM nruchika21 ***@***.***> wrote:
Hi
I am using python 3.6 and trying to pickle and get the error:
TypeError: can't pickle statsmodels.tsa.statespace._statespace.dStatespace
objects
This is how I am doing it:
filename ="model.pkl"
with open(filename, 'wb') as fp:
cPickle.dump(stepwise_fit,fp)
Any ideas as to what I can do to fix this?
Thanks, Any help is much appreciated!
Ruchika
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3402 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFU5Rc-qClMRsGWQCi1fBwTaY5xL6I59ks5tg-w-gaJpZM4LylYB>
.
|
|
Master of what ? |
|
Master version of stats models from github.com.
…On Thu, Mar 22, 2018, 6:51 PM nruchika21 ***@***.***> wrote:
Master of what ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3402 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFU5RTjk55UkK3hfJzSUb8Yjk9gXNpj7ks5tg_K7gaJpZM4LylYB>
.
|
|
I am using what comes with python 3.6, How do I use the master version ?
Thanks,
Ruchika
On Thu, Mar 22, 2018 at 3:16 PM, Kevin Sheppard <[email protected]>
wrote:
… Master version of stats models from github.com.
On Thu, Mar 22, 2018, 6:51 PM nruchika21 ***@***.***> wrote:
> Master of what ?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/statsmodels/statsmodels/pull/
3402#issuecomment-375418797>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/
AFU5RTjk55UkK3hfJzSUb8Yjk9gXNpj7ks5tg_K7gaJpZM4LylYB>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3402 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Aj7Oiho6kRSgxcgGDfneAOg_3vGwrMlYks5tg_iogaJpZM4LylYB>
.
|
|
Somethin like pip install git+https://github.com/statsmodels/statsmodels This requires you to a compiler for your version of Python. |
Minimal patch to allow pickling.
Likely is not correct in the sense that the pickled objects would
not behave the same after pickling.