Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'DecomposeResult' object has no attribute 'save' #8199

Closed
gsamaras opened this issue Mar 28, 2022 · 1 comment
Closed

AttributeError: 'DecomposeResult' object has no attribute 'save' #8199

gsamaras opened this issue Mar 28, 2022 · 1 comment
Milestone

Comments

@gsamaras
Copy link

gsamaras commented Mar 28, 2022

Describe the bug

Unable to save an STL model. This Stack Overflow answer says that: "The models and results instances all have a save and load method, so you don't need to use the pickle module directly.".

Is that true or should I use the pickle module directly?

Code Sample, a copy-pastable example if possible

import statsmodels.api as sm
import matplotlib.pyplot as plt

result = STL(data, period=7).fit()
result.save("STL_model.pickle")

I get this error:

AttributeError: 'DecomposeResult' object has no attribute 'save'

Expected Output

A saved model.

Output of import statsmodels.api as sm; sm.show_versions()

INSTALLED VERSIONS

Python: 3.7.12.final.0
OS: Linux 5.10.90+ #1 SMP Wed Mar 23 09:10:07 UTC 2022 x86_64
byteorder: little
LC_ALL: C.UTF-8
LANG: C.UTF-8

statsmodels

Installed: 0.13.1 (/opt/conda/lib/python3.7/site-packages/statsmodels)

Required Dependencies

cython: 0.29.28 (/opt/conda/lib/python3.7/site-packages/Cython)
numpy: 1.20.3 (/opt/conda/lib/python3.7/site-packages/numpy)
scipy: 1.7.3 (/opt/conda/lib/python3.7/site-packages/scipy)
pandas: 1.3.5 (/opt/conda/lib/python3.7/site-packages/pandas)
dateutil: 2.8.2 (/opt/conda/lib/python3.7/site-packages/dateutil)
patsy: 0.5.2 (/opt/conda/lib/python3.7/site-packages/patsy)

Optional Dependencies

matplotlib: 3.5.1 (/opt/conda/lib/python3.7/site-packages/matplotlib)
backend: module://matplotlib_inline.backend_inline
cvxopt: Not installed
joblib: 1.1.0 (/opt/conda/lib/python3.7/site-packages/joblib)

Developer Tools

IPython: 7.30.1 (/opt/conda/lib/python3.7/site-packages/IPython)
jinja2: 3.0.3 (/opt/conda/lib/python3.7/site-packages/jinja2)
sphinx: Not installed
pygments: 2.10.0 (/opt/conda/lib/python3.7/site-packages/pygments)
pytest: 7.1.0 (/opt/conda/lib/python3.7/site-packages/pytest)
virtualenv: 20.10.0 (/opt/conda/lib/python3.7/site-packages/virtualenv)

@gsamaras
Copy link
Author

OK I didn't think this through and I can't delete this issue. You don't save decomposition result, but the models you train on the components!

@bashtage bashtage modified the milestones: 0.13.2, 0.13.3 Oct 30, 2022
@bashtage bashtage modified the milestones: 0.13.3, 0.14 Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants