-
Notifications
You must be signed in to change notification settings - Fork 89
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
UnboundLocalError: local variable 'periodocity' referenced before assignment #16
Comments
'root cause - it is not able to infer_freq of the date column for that reason it is not able to satisfy any Solution -
@Team can we connect as def time_feature(df,perd): function is not generic. |
@rahul4tripathi2 Thanks I always appreciate when someone comes with solutions. Would you be able to submit a pull request when you see changes needed? Best, Derek. |
Below are the changes which i think should be done in infer_periodicity function. I'm not sure it is optimal code or not. def infer_periodocity(train): return periodocity |
I'm running AtsPy with a date-time index with frequency of A-DEC and receive a "periodicity' error. Could this be due to the "season = infer_from_data" not supporting A-DEC? If so, is there another option to manually specify a season value?
DatetimeIndex(['1997-12-31', '1998-12-31', '1999-12-31', '2000-12-31',
'2001-12-31', '2002-12-31', '2003-12-31', '2004-12-31',
'2005-12-31', '2006-12-31', '2007-12-31', '2008-12-31',
'2009-12-31', '2010-12-31', '2011-12-31', '2012-12-31',
'2013-12-31', '2014-12-31', '2015-12-31', '2016-12-31',
'2017-12-31'],
dtype='datetime64[ns]', freq='A-DEC')
<class 'pandas.core.frame.DataFrame'>
The data has been successfully parsed by infering a frequency, and establishing a 'Date' index and 'Target' column.
15
An insample split of training size 15 and testing size 6 has been constructed
UnboundLocalError Traceback (most recent call last)
in ()
10 model_list=["Prophet"]
11 am = AutomatedModel(df = zillowByZip, model_list=model_list, season="infer_from_data",forecast_len=20)
---> 12 forecast_in, performance = am.forecast_insample()
13 forecast_out = am.forecast_outsample()
14 all_ensemble_in, all_ensemble_out, all_performance = am.ensemble(forecast_in, forecast_out)
4 frames
/usr/local/lib/python3.6/dist-packages/atspy/init.py in infer_periodocity(train)
145 periodocity = 1000
146
--> 147 return periodocity
148
149 def select_seasonality(train, season):
UnboundLocalError: local variable 'periodocity' referenced before assignment
The text was updated successfully, but these errors were encountered: