Exercise

Backtesting with MAE, MSE

In this exercise, you will practice how to evaluate model performance by conducting backtesting. The out-of-sample forecast accuracy is assessed by calculating MSE and MAE.

You can easily estimate prediction errors MSE and MAE with pre-defined functions in the sklearn.metrics package. The actual variance and predicted variance have been preloaded in actual_var and forecast_var respectively.

Instructions

100 XP
  • In evaluate(), perform the MAE calculation by calling the corresponding function from sklean.metrics.
  • In evaluate(), perform the MSE calculation by calling the corresponding function from sklean.metrics.
  • Pass variables to evaluate() in order to perform the backtest.