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

Local Variable is referenced before assignment #2392

Open
kzm-arief opened this issue Mar 23, 2023 · 2 comments
Open

Local Variable is referenced before assignment #2392

kzm-arief opened this issue Mar 23, 2023 · 2 comments

Comments

@kzm-arief
Copy link

kzm-arief commented Mar 23, 2023

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
Copy link

cgobat commented Mar 26, 2023

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
Copy link

cgobat commented Mar 27, 2023

@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.

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