Problem
You are given the file hotel_bookings.csv (drive link in comments) about two hotels: a resort hotel and a city hotel. You have data about each booking: whether it was canceled, how many days in advance of arrival was it booked, year/month/week number/day of arrival, weekend nights, weekday nights, number of adults, number of children, number of babies, meal plan (BB=Bed and Breakfast, FB = Full Board = 3 meals a day, HB = Half Board = breakfast and evening meals), country of residence, market segment (TA/TO means Travel Agent/Travel Office), distribution channel, whether the customer is a repeated guest, whether there have been previous cancellations, previous bookings not canceled, reserved room type, assigned room type, booking changes, deposit type, agent, company, days in waiting list, customer type, average daily rate (adr), required car parking spaces, total of special requests, reservation status, reservation status date.
Use R to generate the outputs.
I. Generate and evaluate two different models predicting ADR, one for each of the hotel types. For each of the hotel types, compare the model you have obtained with the model of the entire data using a validation set drawn from its testing set, and test on the remaining part of the testing set.
II. Generate a table predicting hotel occupancy depending on day/month/year (total number of rooms that would be used in the hotel that night) assuming no stay is cancelled, and a table showing actual occupancy taking into account which stays were cancelled. Combine your models of occupancy and cancellation in a manner of your choice to suggest an overbooking threshold, that is, a fictitious hotel room capacity higher than the actual room capacity such that the number of occupied rooms in the hotel after cancellation is lower than or equal to the actual room capacity.