Exercise

Build regression forecast for new product

We saw in a previous exercise that regression forecasts are also worth building! Your workspace has some preloaded things to help. You have a data frame called MET_sp_train with the variables log_sales, log_price, christmas, valentine, newyear, and mother in it. Your workspace also has a validation data frame MET_sp_valid for predictions.

Instructions

100 XP
  • Build a regression model predicting log of sales with log of price and all the holiday and promotion variables.
  • Forecast out the model with the predict function and the MET_sp_valid data frame.
  • Exponentiate your forecast and create an xts object.
  • Calculate the MAPE using the MET_sp_v object for your validation set. Your MET_sp_valid data frame won't help here as it has all log prices and you want the MAPE on actual prices.