Which statement best describes the Mean Absolute Error (MAE) when used to evaluate time series predictions?
Think about how MAE treats errors without squaring them.
MAE calculates the average absolute difference between predicted and actual values, giving equal weight to all errors regardless of their sign.
What is the output of the following Python code that calculates the Root Mean Squared Error (RMSE) for given true and predicted values?
import numpy as np true = np.array([3, -0.5, 2, 7]) pred = np.array([2.5, 0.0, 2, 8]) rmse = np.sqrt(np.mean((true - pred) ** 2)) print(round(rmse, 3))
Calculate squared errors, average them, then take the square root.
Squared errors: (0.5², (-0.5)², 0², (-1)²) = (0.25, 0.25, 0, 1). Mean = 1.5/4 = 0.375. RMSE = √0.375 ≈ 0.612 (option C).
You have a time series dataset with many small values and a few very large spikes. Which evaluation metric is best to use to avoid the large spikes dominating the error measurement?
Consider which metric is less sensitive to large errors.
MAE treats all errors equally by using absolute values, so large spikes do not disproportionately affect the metric, unlike MSE or RMSE which square errors.
Given the true values [100, 200, 300] and predicted values [110, 190, 310], what is the Mean Absolute Percentage Error (MAPE) expressed as a percentage?
true = [100, 200, 300] pred = [110, 190, 310] errors = [abs(t - p) / t for t, p in zip(true, pred)] mape = sum(errors) / len(errors) * 100 print(round(mape, 2))
Calculate absolute percentage errors for each point, then average.
Errors: |100-110|/100=0.1 (10%), |200-190|/200=0.05 (5%), |300-310|/300≈0.0333 (3.33%). Average ≈0.0611 or 6.11% (option B).
What error does the following Python code raise when calculating Mean Absolute Error (MAE) for time series predictions?
true = [1, 2, 3, 4] pred = [1, 2, 3] mae = sum(abs(t - p) for t, p in zip(true, pred)) / len(true) print(mae)
Check how zip works with lists of different lengths.
zip stops at the shortest list (pred), so only pairs (1,1), (2,2), (3,3) with errors 0,0,0. Sum=0 / len(true)=4 = 0.0. No error.