2

I'm trying to get the run tutorial on kats multi-variete time series model forecasting running but I'm running into an error when running m.predict

Here's the code which can also be found on their tutorial page.

try: # If running on Jupyter
    multi_df = pd.read_csv("../kats/data/multi_ts.csv")
except FileNotFoundError: # If running on colab
    multi_df = pd.read_csv("multi_ts.csv")
multi_ts = TimeSeriesData(multi_df, time_col_name='time')

# Use VAR model to forecast this multivariate time series
from kats.models.var import VARModel, VARParams

params = VARParams()
m = VARModel(multi_ts, params)
m.fit()
fcst = m.predict(steps=90)  # this line yields the error

m.plot()
plt.show()

Theirs already an issue regarding this error on the kats github but has not been commented on.

neil_ruaro
  • 368
  • 3
  • 15
  • 3
    You need to use an older version of statsmodels, of kats needs to update for changes in statsmodels. `y` was deprecated a few years ago and removed in 0.13. The requirements file says `statsmodels==0.12.2` is the supported version. You should install this one. – Kevin S Jan 06 '22 at 14:45

1 Answers1

2

y is a deprecated alias for endog, will be removed in version 0.11.0.

You can use, m.forecast(m.endog, steps=90).

http://statsmodels.org/stable/endog_exog.html

  • 1
    Hello and welcome to StackOverflow. Please check out [how-to-ask](https://stackoverflow.com/help/how-to-answer) to learn how to post a good answer. This includes code blocks for better visibility, and adding the base information from sites you link. – Mahrkeenerh Mar 30 '22 at 18:30
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/31385848) – Dom Mar 30 '22 at 21:02