Challenge: ARIMA Forecasting and Evaluation
Swipe to start coding
You will build, forecast, and evaluate an ARIMA model using the built-in AirPassengers dataset.
Perform the following steps:
-
Load the dataset
flightsfrom seaborn and extract the"passengers"series as a time series indexed by month. -
Split the data into:
- Training set → all data except the last 12 months
- Testing set → last 12 months
-
Fit an ARIMA(2,1,2) model on the training set using
statsmodels.tsa.arima.model.ARIMA. -
Forecast the next 12 months.
-
Compute and print the following metrics between the forecast and the actual test values:
- Mean Absolute Error (MAE)
- Root Mean Squared Error (RMSE)
-
Plot:
- The original series
- The forecasted values over the test range.
Solution
Merci pour vos commentaires !
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Awesome!
Completion rate improved to 6.67
Challenge: ARIMA Forecasting and Evaluation
Glissez pour afficher le menu
Swipe to start coding
You will build, forecast, and evaluate an ARIMA model using the built-in AirPassengers dataset.
Perform the following steps:
-
Load the dataset
flightsfrom seaborn and extract the"passengers"series as a time series indexed by month. -
Split the data into:
- Training set → all data except the last 12 months
- Testing set → last 12 months
-
Fit an ARIMA(2,1,2) model on the training set using
statsmodels.tsa.arima.model.ARIMA. -
Forecast the next 12 months.
-
Compute and print the following metrics between the forecast and the actual test values:
- Mean Absolute Error (MAE)
- Root Mean Squared Error (RMSE)
-
Plot:
- The original series
- The forecasted values over the test range.
Solution
Merci pour vos commentaires !
single