Skip to content

forecasting - get fitted values #888

Answered by mloning
eyalshafran asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @eyalshafran you have two options:

Using the sktime interface for in-sample predictions (this should work for all forecasters):

from sktime.datasets import load_airline
from sktime.forecasting.exp_smoothing import ExponentialSmoothing
from sktime.forecasting.model_selection import temporal_train_test_split
from sktime.forecasting.base import ForecastingHorizon

y = load_airline()
y_train, y_test = temporal_train_test_split(y, test_size=36)
model = ExponentialSmoothing(sp=12, trend='add', seasonal='add')
model.fit(y_train)
fh = ForecastingHorizon(y_train.index, is_relative=False)  # in-sample forecasting horizon
model.predict(fh)

Accessing the statsmodels used internally (this will only…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@mloning
Comment options

@eyalshafran
Comment options

@mloning
Comment options

@eyalshafran
Comment options

@mloning
Comment options

Answer selected by eyalshafran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants