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.
Lösning
Tack för dina kommentarer!
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me an example?
Awesome!
Completion rate improved to 6.67
Challenge: ARIMA Forecasting and Evaluation
Svep för att visa menyn
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.
Lösning
Tack för dina kommentarer!
single