facebook/prophet

Local Variable is referenced before assignment

kzm-arief opened this issue · 2 comments

So I tried to use prophet as usual. But suddenly there's a new error regarding this:

UnboundLocalError: local variable 'forecast_df_folds' referenced before assignment

I'm not sure is this just a local error in my computer or the latest update do give this error sometimes. Here is the more detailed expression:

[/usr/local/lib/python3.9/dist-packages/auto_ts/__init__.py](https://localhost:8080/#) in fit(self, traindata, ts_column, target, sep, cv)
    573 
    574             self.ml_dict[name]['model'] = model
--> 575             self.ml_dict[name]['forecast'] = forecast_df_folds
    576             self.ml_dict[name][self.score_type] = score_val
    577             self.ml_dict[name]['model_build'] = model_build
cgobat commented

Looks like a problem with Auto_TS, not prophet directly. Based on these lines of code, it seems you probably ran into an exception during the try block in either the model_build = BuildProphet(...) or model_build.fit(...) calls, which was caught by the except Exception as e, but meant that forecast_df_folds was left undefined after the fact.

cgobat commented

@kzm-arief the auto_ts issue mentioned above has been fixed. Try downloading the latest version of that module to see if your problem is resolved.