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

model fit method throws error "local variable 'forecast_df_folds' referenced before assignment" #43

Closed
ashish-cerv opened this issue Mar 1, 2021 · 6 comments

Comments

@ashish-cerv
Copy link

I installed the package using pip and then cloned the repo to test run the example notebook.
It throws the following error.
Start of Fit.....
Running Augmented Dickey-Fuller test with paramters:
maxlag: 5 regression: c autolag: BIC
Results of Augmented Dickey-Fuller Test:
+-----------------------------+------------------------------+
| | Dickey-Fuller Augmented Test |
+-----------------------------+------------------------------+
| Test Statistic | -3.2721577323655944 |
| p-value | 0.01616983190458116 |
| #Lags Used | 1.0 |
| Number of Observations Used | 43.0 |
| Critical Value (1%) | -3.5925042342183704 |
| Critical Value (5%) | -2.931549768951162 |
| Critical Value (10%) | -2.60406594375338 |
+-----------------------------+------------------------------+
this series is stationary
Target variable given as = Sales
Start of loading of data.....
Input is data frame. Performing Time Series Analysis
ts_column: Time Period sep: , target: Sales
Loaded pandas dataframe...
pandas Dataframe loaded successfully. Shape of data set = (45, 2)
chart frequency not known. Continuing...
Time Interval between observations has not been provided. Auto_TS will try to infer this now...
Time series input in days = 31
It is a Monthly time series.
WARNING: Running best models will take time... Be Patient...

==================================================
Building Prophet Model

Running Facebook Prophet Model...
Fit-Predict data (shape=(45, 3)) with Confidence Interval = 0.95...
Starting Prophet Fit
No seasonality assumed since seasonality flag is set to False
Starting Prophet Cross Validation
Max. iterations using expanding window cross validation = 3

Fold Number: 1 --> Train Shape: 30 Test Shape: 5
Root Mean Squared Error predictions vs actuals = 42.30
Std Deviation of actuals = 126.63
Normalized RMSE = 33%
Cross Validation window: 1 completed

Fold Number: 2 --> Train Shape: 35 Test Shape: 5
Root Mean Squared Error predictions vs actuals = 20.71
Std Deviation of actuals = 68.89
Normalized RMSE = 30%
Cross Validation window: 2 completed

Fold Number: 3 --> Train Shape: 40 Test Shape: 5
Root Mean Squared Error predictions vs actuals = 53.09
Std Deviation of actuals = 82.02
Normalized RMSE = 65%
Cross Validation window: 3 completed


Model Cross Validation Results:

MAE (as % Std Dev of Actuals) = 25.56%
MAPE (Mean Absolute Percent Error) = 5%
RMSE (Root Mean Squared Error) = 40.9755
Normalized RMSE (MinMax) = 11%
Normalized RMSE (as Std Dev of Actuals)= 31%

Time Taken = 6 seconds
Exception occurred while building Prophet model...
Prophet object can only be fit once. Instantiate a new object.
FB Prophet may not be installed or Model is not running...

UnboundLocalError Traceback (most recent call last)
in
----> 1 model.fit(
2 traindata=train,
3 ts_column=ts_column,
4 target=target,
5 cv=3,

~\Anaconda3\lib\site-packages\auto_ts_init_.py in fit(self, traindata, ts_column, target, sep, cv)
504
505 self.ml_dict[name]['model'] = model
--> 506 self.ml_dict[name]['forecast'] = forecast_df_folds
507 self.ml_dict[name][self.score_type] = score_val
508 self.ml_dict[name]['model_build'] = model_build

UnboundLocalError: local variable 'forecast_df_folds' referenced before assignment

@AutoViML
Copy link
Owner

AutoViML commented Mar 3, 2021

ashish-cerv

Hah. Let me fix this in a day or two.
Thx
Ram

@kenny-pee
Copy link

Hi, has this been resolved?

@YingXu001
Copy link

Hi, it still seems cannot work.

@AutoViML
Copy link
Owner

AutoViML commented Mar 14, 2021 via email

@YingXu001
Copy link

YingXu001 commented Mar 15, 2021 via email

@AutoViML
Copy link
Owner

AutoViML commented Apr 1, 2021

Great! Closing this issue as fixed.

@AutoViML AutoViML closed this as completed Apr 1, 2021
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

4 participants