'ThetaModelResults' object has no attribute 'get_prediction'

60 views
Skip to first unread message

Matt F

unread,
Dec 16, 2022, 9:13:59 AM12/16/22
to pystatsmodels
Hello,

I am creating a theta forecasting model and would like to get predictions for the training data. I have a forecast for the next 12 months, but would like to know what the model is predicting for the training data, to compare with actual values.

I just made a similar model using STLForecast and it had this attribute. Does anyone know a work around for this issue or what I am doing wrong?

Best,


Matt

unread,
Dec 16, 2022, 10:00:14 AM12/16/22
to pystatsmodels
Attached is the code I am using to get  the error I am receiving

 extra_periods = len(df_test2)

    theta = ThetaModel(d, period = 12)
    res_theta = theta.fit()
    predictions_test = np.round(np.exp(res_theta.forecast(extra_periods, theta = 2).values))
    predictions_train = res_theta.get_prediction()
    print(predictions_train)
Reply all
Reply to author
Forward
0 new messages