Exercise

Predicting shares for the racer segment

Let's predict shares for a different sportscar segment. I've preloaded the m5 model and the predict_mnl() function I showed you in the video. In the sample code, you will also see my code for creating the prod data frame. Your task is to modify my code to predict shares for the "racer" segment.

Instructions

100 XP
  • Modify my code for creating the prod data frame so the segment variable is "racer" for both products. Remember that user variables like segment should be the same for all the products in prod.
  • Predict shares for the products in prod using the m5 model. You can use my predict_mnl() function to do this. Make sure the output indicates that the segment is "racer" for both products.