-
Notifications
You must be signed in to change notification settings - Fork 880
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
A first minimal version of timeseries lib #1
Conversation
|
||
class ExponentialSmoothing(TimeseriesModel): | ||
|
||
def __init__(self, trend='additive', seasonal='additive', seasonal_periods=12): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to documentation we should use endog parameter,
class statsmodels.tsa.holtwinters.ExponentialSmoothing(endog, trend=None, damped=False, seasonal=None, seasonal_periods=None, dates=None, freq=None, missing='none')
I've encountered an error while I was using ExpotentialSmoothing (init() missing 1 required positional argument: 'endog')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you called u8timeseries.ExponentialSmoothing
? It seems you called the statsmodels
version.
The code should look like this:
import pandas as pd
from u8timeseries import ExponentialSmoothing
my_df = pd.DataFrame({
'timestep': [1, 2, 3],
'values': [4, 5, 6]
})
my_model = ExponentialSmoothing()
my_model.fit(my_df, 'values')
# n step ahead prediction:
predictions = my_model.predict(n=6)
print(predictions)
Co-authored-by: Julien Herzen <julien.herzen@unit8.co>
Co-authored-by: Julien Herzen <julien.herzen@unit8.co> Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Joint work with @kstyrc
Check the README and try it!