1. Learn
  2. /
  3. Courses
  4. /
  5. Feature Engineering in R

Exercise

Predicting hotel bookings

You just got a job at a hospitality research company, and your first task is to build a model that predicts whether or not a hotel stay will include children. To train your model, you will rely on a modified version of the hotel booking demands dataset by Antonio, Almeida, and Nunes (2019). You are restricting your data to the following features:

features <- c('hotel', 'adults', 
              'children', 'meal',
              'reserved_room_type', 
              'customer_type', 
              'arrival_date')

The data has been loaded for you as hotels, along with its corresponding test and train splits, and the model has been declared as lr_model <- logistic_reg().

You will assess model performance by accuracy and area under the ROC curve or AUC.

Instructions 1/2

undefined XP
    1
    2
  • Generate "day of the week", "week" and "month" features.
  • Create dummy variables for all nominal predictors.