Forecasting, Data Science, Python, Data Visualization, Machine Learning.
index = pd.date_range(start=data.index[-1], periods = 12, freq = 'MS')) # Plot the data and forecast data.plot(label = 'Observed') forecast.plot(label = 'Naive Forecast', color = 'red') plt.legend() plt.title("Naive Forecast") plt.xlabel("Year") plt.ylabel("Passengers") plt.show() B2. Naive