intive-DataScience / tbats

BATS and TBATS forecasting methods
MIT License
178 stars 19 forks source link

NotImplementedError() #7

Closed LoveenDyall closed 5 years ago

LoveenDyall commented 5 years ago

File "/../venv/lib/python3.7/site-packages/tbats/abstract/Estimator.py", line 95, in fit return self.context.create_constant_model(y[0]).fit(y) File "/../venv/lib/python3.7/site-packages/tbats/tbats/Context.py", line 17, in create_constant_model ModelParams(components=Components.create_constant_components(), alpha=0, x0=[constant_value]) File "/../venv/lib/python3.7/site-packages/tbats/abstract/Components.py", line 71, in create_constant_components raise NotImplementedError() NotImplementedError

Seems to be that if np.allclose(y, y[0]) == True, then this gets raised. wondering how to avoid or what plans are for implementation updates?

cotterpl commented 5 years ago

I have released 1.0.8 today and it fixes this problem. The problem you are seeing is becasue all of your input series have exactly the same value (they are constant). It means no other than constant model returning this one an only value makes sense.