Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikdata/hotel-modeling
hotel modeling problem
https://github.com/nikdata/hotel-modeling
Last synced: 3 days ago
JSON representation
hotel modeling problem
- Host: GitHub
- URL: https://github.com/nikdata/hotel-modeling
- Owner: nikdata
- License: mit
- Created: 2020-04-15T02:32:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-30T13:40:32.000Z (over 4 years ago)
- Last Synced: 2024-11-09T07:38:44.666Z (about 2 months ago)
- Language: R
- Size: 188 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Predicting Hotel Booking Cancellations
## TL;DR
This repo contains a tutorial on how to leverage {keras} and PlaidML (an alternative to TensorFlow) to build a simple binary classification model using a GPU.## Background
I found it challenging to find a simple walk-through in R that built a simple classification model using {keras}'s Functional API and PlaidML. PlaidML is an open source framework that works with almost any GPU unlike TensorFlow. Furthermore, if you rely on a newer Mac, you are unable to use an nVidia GPU (which is required for TensorFlow) and must rely on an AMD GPU. For that purpose, I found that PlaidML works well and it works on any branded GPU. While PlaidML is nothing more than a frame-work, its key benefit is that the overall coding doesn't change much. Lastly, many of the walkthroughs for building models in {keras} and R seem to rely on the sequential approach and not so much on the functional API approach.
## Walkthrough
The walkthrough can be found [here](https://github.com/nikdata/hotel-modeling/blob/master/hotel-analysis.md)
## Full Code
The full code is [here](https://github.com/nikdata/hotel-modeling/blob/master/full-code.R).
## Next Steps
My next step (time permitting) is to create this walkthrough in Python.
## References
### Source
[Antonio, Almeida and Nunes, 2019](https://www.sciencedirect.com/science/article/pii/S2352340918315191#f0010)
[Tidy Tuesday](https://github.com/rfordatascience/tidytuesday/tree/master/data/2020/2020-02-11)### Hat tip
[RStudio AI Blog: Deep Learning with Keras to Predict Customer Churn](https://blogs.rstudio.com/tensorflow/posts/2018-01-11-keras-customer-churn/)
[RStudio AI Blog: Word Embeddings](https://blogs.rstudio.com/tensorflow/posts/2017-12-22-word-embeddings-with-keras/)
[Machine Learning Mastery: Regression Tutorial with Keras](https://machinelearningmastery.com/regression-tutorial-keras-deep-learning-library-python/)### Data Dictionary
|variable |class |description |
|:------------------------------|:---------|:-----------|
|hotel |character | Hotel (H1 = Resort Hotel or H2 = City Hotel) |
|is_canceled |double | Value indicating if the booking was canceled (1) or not (0) |
|lead_time |double | Number of days that elapsed between the entering date of the booking into the PMS and the arrival date |
|arrival_date_year |double | Year of arrival date|
|arrival_date_month |character | Month of arrival date|
|arrival_date_week_number |double | Week number of year for arrival date|
|arrival_date_day_of_month |double | Day of arrival date|
|stays_in_weekend_nights |double | Number of weekend nights (Saturday or Sunday) the guest stayed or booked to stay at the hotel |
|stays_in_week_nights |double | Number of week nights (Monday to Friday) the guest stayed or booked to stay at the hotel|
|adults |double | Number of adults|
|children |double | Number of children|
|babies |double |Number of babies |
|meal |character | Type of meal booked. Categories are presented in standard hospitality meal packages:
Undefined/SC – no meal package;
BB – Bed & Breakfast;
HB – Half board (breakfast and one other meal – usually dinner);
FB – Full board (breakfast, lunch and dinner) |
|country |character | Country of origin. Categories are represented in the ISO 3155–3:2013 format |
|market_segment |character | Market segment designation. In categories, the term “TA” means “Travel Agents” and “TO” means “Tour Operators” |
|distribution_channel |character | Booking distribution channel. The term “TA” means “Travel Agents” and “TO” means “Tour Operators” |
|is_repeated_guest |double | Value indicating if the booking name was from a repeated guest (1) or not (0) |
|previous_cancellations |double | Number of previous bookings that were cancelled by the customer prior to the current booking |
|previous_bookings_not_canceled |double | Number of previous bookings not cancelled by the customer prior to the current booking |
|reserved_room_type |character | Code of room type reserved. Code is presented instead of designation for anonymity reasons |
|assigned_room_type |character | Code for the type of room assigned to the booking. Sometimes the assigned room type differs from the reserved room type due to hotel operation reasons (e.g. overbooking) or by customer request. Code is presented instead of designation for anonymity reasons |
|booking_changes |double | Number of changes/amendments made to the booking from the moment the booking was entered on the PMS until the moment of check-in or cancellation|
|deposit_type |character | Indication on if the customer made a deposit to guarantee the booking. This variable can assume three categories:
No Deposit – no deposit was made;
Non Refund – a deposit was made in the value of the total stay cost;
Refundable – a deposit was made with a value under the total cost of stay. |
|agent |character | ID of the travel agency that made the booking |
|company |character | ID of the company/entity that made the booking or responsible for paying the booking. ID is presented instead of designation for anonymity reasons |
|days_in_waiting_list |double | Number of days the booking was in the waiting list before it was confirmed to the customer |
|customer_type |character | Type of booking, assuming one of four categories:
Contract - when the booking has an allotment or other type of contract associated to it;
Group – when the booking is associated to a group;
Transient – when the booking is not part of a group or contract, and is not associated to other transient booking;
Transient-party – when the booking is transient, but is associated to at least other transient booking|
|adr |double | Average Daily Rate as defined by dividing the sum of all lodging transactions by the total number of staying nights |
|required_car_parking_spaces |double | Number of car parking spaces required by the customer |
|total_of_special_requests |double | Number of special requests made by the customer (e.g. twin bed or high floor)|
|reservation_status |character | Reservation last status, assuming one of three categories:
Canceled – booking was canceled by the customer;
Check-Out – customer has checked in but already departed;
No-Show – customer did not check-in and did inform the hotel of the reason why |
|reservation_status_date |double | Date at which the last status was set. This variable can be used in conjunction with the ReservationStatus to understand when was the booking canceled or when did the customer checked-out of the hotel|