Closed BinhHong closed 2 years ago
Hi @BinhHong ,Thanks for sharing the issue!, can you provide more context, the code and the plot to replicate the issue?
Hi @MoKazemi9 , the code here is exactly the same as in tutorial https://github.com/facebookresearch/Kats/blob/main/tutorials/kats_201_forecasting.ipynb.
The dataset is air_passengers.csv
air_passengers_df = pd.read_csv("air_passengers.csv")
air_passengers_df.columns = ["time", "value"]
air_passengers_ts = TimeSeriesData(air_passengers_df)
from kats.models.sarima import SARIMAModel, SARIMAParams
warnings.simplefilter(action='ignore')
# create SARIMA param class
params = SARIMAParams(
p = 2,
d=1,
q=1,
trend = 'ct',
seasonal_order=(1,0,1,12)
)
# initiate SARIMA model
m = SARIMAModel(data=air_passengers_ts, params=params)
# fit SARIMA model
m.fit()
# generate forecast values
fcst = m.predict(
steps=30,
freq="MS"
)
Then m.plot()
produces
whereas in the tutorial
@BinhHong I'm facing the same issue with the Ensemble model. A couple of weeks ago my graphs showed the actual and forecasted trends together but now as I try to replicate my results with the same code and data, they just show the forecasted trends.
I suggest you try the following:
# generate forecast values fcst = m.predict( steps=30, freq="MS" include_history = True )
I tried it for Ensemble, but it shows some error. However, in the case of SARIMA it works for me.
Hi @SakshiNYCU, thanks a lot for your suggestion. The result looks as I expected
compared to the tutorial
I run the code in Prophet Forecast in tutorial with the
air_passengers
dataset and m.plot() but the result doesn't match the output there. If I remember correctly, it used to.