Closed Sprinting closed 6 years ago
Great find, thanks for reporting the issue! I'll take a look and try to reproduce on my end.
I'm on a unix machine, so not a 1x1 comparison, but here's how I'm trying to replicate:
$ conda create -n pmd_issue25 python=3.6 numpy=1.14 \
scipy=1.0.0 scikit-learn=0.19.1 statsmodels=0.8.0
$ source activate pmd_issue25
$ (pmd_issue25) pip install pyramid-arima==0.6.5
And I am indeed seeing the same issues:
>>> rs_fit = auto_arima(wineind, start_p=1, start_q=1, max_p=3, max_q=3, m=12,
... start_P=0, seasonal=True, n_jobs=-1, d=1, D=1, trace=True,
... error_action='ignore', # don't want to know if an order does not work
... suppress_warnings=True, # don't want convergence warnings
... stepwise=False, random=True, random_state=42, # we can fit a random search (not exhaustive)
... n_fits=25)
Fit ARIMA: order=(3, 1, 2) seasonal_order=(1, 1, 1, 12); AIC=nan, BIC=nan, Fit time=nan seconds
Fit ARIMA: order=(1, 1, 3) seasonal_order=(0, 1, 1, 12); AIC=3068.842, BIC=3091.036, Fit time=1.769 seconds
Fit ARIMA: order=(3, 1, 3) seasonal_order=(0, 1, 1, 12); AIC=3072.626, BIC=3101.160, Fit time=2.591 seconds
Fit ARIMA: order=(2, 1, 1) seasonal_order=(0, 1, 2, 12); AIC=3068.503, BIC=3090.696, Fit time=4.930 seconds
Traceback (most recent call last):
File "<stdin>", line 6, in <module>
File "//anaconda/envs/pmd_issue25/lib/python3.6/site-packages/pyramid/arima/auto.py", line 576, in auto_arima
for order, seasonal_order in gen)
File "//anaconda/envs/pmd_issue25/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 789, in __call__
self.retrieve()
File "//anaconda/envs/pmd_issue25/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 699, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "//anaconda/envs/pmd_issue25/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
multiprocessing.pool.MaybeEncodingError: Error sending result: '[ARIMA(callback=None, disp=0, maxiter=50, method=None, order=(2, 1, 1),
out_of_sample_size=0, scoring='mse', scoring_args={},
seasonal_order=(0, 1, 2, 12), solver='lbfgs', start_params=None,
suppress_warnings=True, transparams=True, trend='c')]'. Reason: 'TypeError("can't pickle statsmodels.tsa.statespace._statespace.dStatespace objects",)'
This is strange because parallel fits are tested in the unit tests, so not sure whether this is a versioning thing or what... I'll dig into it, but my immediate advice would be to use stepwise=True
for the time being.
@tgsmith61591 thank you for looking into this - I'm using stepwise=True
since I needed it to be somewhat fast, but reported it anyways since I came across it while following the example,
Edt: Thank you
Seems related to this statsmodels issue. You have two options:
master
branch$ conda create -n pmd_issue25_py35 python=3.5 numpy=1.14 \
scipy=1.0.0 scikit-learn=0.19.1 statsmodels=0.8.0
$ source activate pmd_issue25_py35
$ (pmd_issue25_py35) pip install pyramid-arima==0.6.5
Works:
>>> rs_fit = auto_arima(wineind, start_p=1, start_q=1, max_p=3, max_q=3, m=12,
... start_P=0, seasonal=True, n_jobs=-1, d=1, D=1, trace=True,
... error_action='ignore', # don't want to know if an order does not work
... suppress_warnings=True, # don't want convergence warnings
... stepwise=False, random=True, random_state=42, # we can fit a random search (not exhaustive)
... n_fits=25)
Fit ARIMA: order=(3, 1, 2) seasonal_order=(1, 1, 1, 12); AIC=nan, BIC=nan, Fit time=nan seconds
Fit ARIMA: order=(1, 1, 3) seasonal_order=(0, 1, 1, 12); AIC=3068.842, BIC=3091.036, Fit time=1.668 seconds
Fit ARIMA: order=(3, 1, 3) seasonal_order=(0, 1, 1, 12); AIC=3072.626, BIC=3101.160, Fit time=2.268 seconds
Fit ARIMA: order=(2, 1, 1) seasonal_order=(0, 1, 2, 12); AIC=3068.503, BIC=3090.696, Fit time=4.990 seconds
Fit ARIMA: order=(2, 1, 3) seasonal_order=(1, 1, 1, 12); AIC=3071.522, BIC=3100.057, Fit time=3.874 seconds
Fit ARIMA: order=(1, 1, 2) seasonal_order=(1, 1, 1, 12); AIC=3068.086, BIC=3090.280, Fit time=1.013 seconds
Fit ARIMA: order=(1, 1, 2) seasonal_order=(0, 1, 1, 12); AIC=3066.771, BIC=3085.794, Fit time=1.282 seconds
Fit ARIMA: order=(2, 1, 2) seasonal_order=(1, 1, 1, 12); AIC=3070.025, BIC=3095.389, Fit time=1.888 seconds
Fit ARIMA: order=(1, 1, 1) seasonal_order=(1, 1, 2, 12); AIC=3068.757, BIC=3090.951, Fit time=10.621 seconds
Fit ARIMA: order=(3, 1, 3) seasonal_order=(0, 1, 2, 12); AIC=3073.580, BIC=3105.285, Fit time=13.863 seconds
Fit ARIMA: order=(3, 1, 2) seasonal_order=(1, 1, 2, 12); AIC=nan, BIC=nan, Fit time=nan seconds
Fit ARIMA: order=(1, 1, 3) seasonal_order=(0, 1, 2, 12); AIC=3069.854, BIC=3095.218, Fit time=15.224 seconds
Fit ARIMA: order=(3, 1, 1) seasonal_order=(0, 1, 2, 12); AIC=3070.436, BIC=3095.800, Fit time=6.790 seconds
Fit ARIMA: order=(2, 1, 2) seasonal_order=(0, 1, 1, 12); AIC=3068.701, BIC=3090.895, Fit time=1.036 seconds
Fit ARIMA: order=(1, 1, 1) seasonal_order=(2, 1, 2, 12); AIC=3070.103, BIC=3095.467, Fit time=20.696 seconds
Fit ARIMA: order=(1, 1, 1) seasonal_order=(2, 1, 1, 12); AIC=3070.302, BIC=3092.495, Fit time=14.282 seconds
Fit ARIMA: order=(3, 1, 3) seasonal_order=(1, 1, 1, 12); AIC=3073.552, BIC=3105.257, Fit time=4.957 seconds
Fit ARIMA: order=(2, 1, 3) seasonal_order=(0, 1, 1, 12); AIC=3070.642, BIC=3096.006, Fit time=2.583 seconds
Fit ARIMA: order=(1, 1, 3) seasonal_order=(2, 1, 2, 12); AIC=3072.019, BIC=3103.723, Fit time=30.945 seconds
Fit ARIMA: order=(1, 1, 2) seasonal_order=(1, 1, 2, 12); AIC=3069.717, BIC=3095.081, Fit time=12.080 seconds
Fit ARIMA: order=(3, 1, 3) seasonal_order=(2, 1, 1, 12); AIC=3075.533, BIC=3110.408, Fit time=33.650 seconds
Fit ARIMA: order=(1, 1, 3) seasonal_order=(1, 1, 2, 12); AIC=3071.758, BIC=3100.293, Fit time=13.260 seconds
Fit ARIMA: order=(2, 1, 3) seasonal_order=(2, 1, 1, 12); AIC=3073.538, BIC=3105.242, Fit time=28.746 seconds
Fit ARIMA: order=(2, 1, 3) seasonal_order=(1, 1, 2, 12); AIC=3073.553, BIC=3105.258, Fit time=23.821 seconds
Fit ARIMA: order=(1, 1, 3) seasonal_order=(2, 1, 1, 12); AIC=3072.048, BIC=3100.582, Fit time=6.794 seconds
Total fit time: 38.469 seconds
Description
Example: MaybeEncodingError raised when following example notebook
Steps/Code to Reproduce
-->
Expected Results
Results Obtained from following : https://www.github.com/tgsmith61591/pyramid/blob/master/examples/quick_start_example.ipynb
Versions