BaşlayınÜcretsiz Başlayın

Mean absolute error

Obviously, before you use the model to predict, you want to know how accurate your predictions are. The mean absolute error (MAE) is a good statistic for this. It is the mean difference between your predictions and the true values.

In this exercise you will calculate the MAE for an ARMA(1,1) model fit to the earthquakes time series

numpy has been imported into your environment as np and the earthquakes time series is available for you as earthquake.

Bu egzersiz

ARIMA Models in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use np functions to calculate the Mean Absolute Error (MAE) of the .resid attribute of the results object.
  • Print the MAE.
  • Use the DataFrame's .plot() method with no arguments to plot the earthquake time series.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Fit model
model = ARIMA(earthquake, order=(1,0,1))
results = model.fit()

# Calculate the mean absolute error from residuals
mae = ____

# Print mean absolute error
print(____)

# Make plot of time series for comparison
____
plt.show()
Kodu Düzenle ve Çalıştır