Manuel
08/03/2023, 11:06 AMAutoARIMA
when I set both stepwise=False
and max_q=0
I get this error:
File /opt/conda/lib/python3.10/site-packages/statsforecast/core.py:581, in _StatsForecast.fit(self, df, sort_df)
579 self.fitted_ = self.ga.fit(models=self.models)
580 else:
--> 581 self.fitted_ = self._fit_parallel()
582 return self
File /opt/conda/lib/python3.10/site-packages/statsforecast/core.py:940, in _StatsForecast._fit_parallel(self)
938 future = executor.apply_async(ga.fit, (self.models,))
939 futures.append(future)
--> 940 fm = np.vstack([f.get() for f in futures])
941 return fm
File /opt/conda/lib/python3.10/site-packages/statsforecast/core.py:940, in <listcomp>(.0)
938 future = executor.apply_async(ga.fit, (self.models,))
939 futures.append(future)
--> 940 fm = np.vstack([f.get() for f in futures])
941 return fm
File /opt/conda/lib/python3.10/multiprocessing/pool.py:774, in ApplyResult.get(self, timeout)
772 return self._value
773 else:
--> 774 raise self._value
UnboundLocalError: local variable 'best_fit' referenced before assignment
Kevin Kho
08/03/2023, 4:52 PMManuel
08/03/2023, 4:55 PMstepwise=False
(which in my case works fine until I also set max_q=0
)Kevin Kho
08/03/2023, 4:56 PMBartosz Bohaterewicz
08/03/2023, 9:49 PMKevin Kho
08/03/2023, 9:52 PMrange()
alsoManuel
08/03/2023, 10:33 PMKevin Kho
08/03/2023, 10:48 PMManuel
08/03/2023, 10:55 PMfor i in range(max_p + 1):
for j in range(max_q + 1):
for I in range(max_P + 1):
for J in range(max_Q + 1):
if i + j + I + J > max_order:
So that the fit is executed at least 1 time even when one of those parameters is set to zero.Kevin Kho
08/03/2023, 10:56 PMManuel
08/03/2023, 10:59 PMfor (i in 0:max.p) {
for (j in 0:max.q) {
for (I in 0:max.P) {
for (J in 0:max.Q) {
:max.p etc. is inclusive, so you have to add 1 to get the same behavior in PythonKevin Kho
08/03/2023, 11:01 PMManuel
08/03/2023, 11:09 PMKevin Kho
08/04/2023, 1:03 AMManuel
08/04/2023, 8:11 AMKevin Kho
08/04/2023, 1:51 PMMariana Menchero
08/04/2023, 7:26 PM