{"id":22563873,"url":"https://github.com/datalopes1/hotel_reservations","last_synced_at":"2026-04-27T21:31:57.626Z","repository":{"id":255273759,"uuid":"848590716","full_name":"datalopes1/hotel_reservations","owner":"datalopes1","description":"Predicting booking status with machine learning","archived":false,"fork":false,"pushed_at":"2024-08-29T13:10:06.000Z","size":28566,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T13:14:22.394Z","etag":null,"topics":["lightgbm","lightgbm-classifier","machine-learning","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datalopes1.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T03:28:45.000Z","updated_at":"2024-08-29T13:11:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"65095dc2-bb35-4cf6-875f-d99222568cf8","html_url":"https://github.com/datalopes1/hotel_reservations","commit_stats":null,"previous_names":["datalopes1/hotel_reservations"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datalopes1/hotel_reservations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datalopes1%2Fhotel_reservations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datalopes1%2Fhotel_reservations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datalopes1%2Fhotel_reservations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datalopes1%2Fhotel_reservations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datalopes1","download_url":"https://codeload.github.com/datalopes1/hotel_reservations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datalopes1%2Fhotel_reservations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32356598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lightgbm","lightgbm-classifier","machine-learning","python"],"created_at":"2024-12-07T23:13:15.013Z","updated_at":"2026-04-27T21:31:57.610Z","avatar_url":"https://github.com/datalopes1.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hotel Booking Status Prediction 🏨\n![](doc/img/manuel-moreno-DGa0LQ0yDPc-unsplash.jpg)\n\n## Content\n- [Introduction](#introduction)\n- [Goals](#goals)\n- [Data](#data)\n- [Modeling tools](#modeling-tools)\n- [Results](#results)\n- [Tools](#tools)\n\n## Introduction\nThe online hotel reservation channels have dramatically changed booking possibilities and customers’ behavior. A significant number of hotel reservations are called-off due to cancellations or no-shows. The typical reasons for cancellations include change of plans, scheduling conflicts, etc. This is often made easier by the option to do so free of charge or preferably at a low cost which is beneficial to hotel guests but it is a less desirable and possibly revenue-diminishing factor for hotels to deal with.\n\n## Goals\nSo the goals of this project is (1) explore data to find insights about cancelations, and (2) to build a machine learning model capable of predicting cancelations or no-shows beforehand. \n\n## Data\n| **Feature**| **Description**|\n|---|---|\n|**Booking_ID**| Unique identifier of each booking|\n|**no_of_adults**| Number of adults|\n|**no_of_children**| Number of children|\n|**no_of_weekend_nights**| Number of weekend nights (Saturday or Sunday) the guest stayed or booked to stay at the hotel|\n|**no_of_week_nights**| Number of week nights (Monday to Friday) the guest stayed or booked to stay at the hotel|\n|**type_of_meal_plan**| Type of meal plan booked by the customer|\n|**required_car_parking_space**| Does the customer require a car parking space? (0 - No, 1 - Yes)|\n|**room_type_reserved**| Type of room reserved by the customer. The values are ciphered (encoded) by INN Hotels|\n|**lead_time**| Number of days between the date of booking and the arrival date|\n|**arrival_year**| Year of arrival date|\n|**arrival_month**| Month of arrival date|\n|**arrival_date**| Date of the month|\n|**market_segment_type**| Market segment designation|\n|**repeated_guest**| Is the customer a repeated guest? (0 - No, 1 - Yes)|\n|**no_of_previous_cancellations**| Number of previous bookings that were canceled by the customer prior to the current booking|\n|**no_of_previous_bookings_not_canceled** | Number of previous bookings not canceled by the customer prior to the current booking|\n|**avg_price_per_room**| Average price per day of the reservation; prices of the rooms are dynamic (in euros)|\n|**no_of_special_requests**| Total number of special requests made by the customer (e.g. high floor, view from the room, etc)|\n|**booking_status**| Flag indicating if the booking was canceled or not|\n\nThis dataset is available in [Kaggle](https://www.kaggle.com/datasets/ahsan81/hotel-reservations-classification-dataset) and was uploaded by Ahsan Raza.\n\n## Modeling tools\n#### Preprocessing\n- Scikit-learn, Optuna, Category Encoders, Feature Engine.\n#### Model\n- LightGBM.\n#### Metrics\n- Accuracy, F1 Score, ROC AUC. \n\n## Results\n### Exploratory Data Analysis insights\n- Reservations with long lead times need to be closely tracked. Simple actions like periodic confirmation messages or emails can be a good plan, as we've seen that the probability of cancellation starts to rise with longer lead times.\n- A higher number of children increases the probability of cancellation, so this is also something to keep track of.\n- Room Type 1 is the most popular, while Room Type 6 has the highest number of cancellations.\n- The Online segment is the most popular and also has the highest cancellation rate. The Complementary and Corporate segments have the lowest cancellation rates, so it may be a good idea to reward them.\n\n### Classification model\n#### Metrics\n|Metric|Result|\n|---|---|\n|**Accuracy**| 0.8983|\n|**F1 Score**| 0.8359|\n|**ROC AUC**| 0.9539|\n\n#### Cross-validation\n|Stat|Result|\n|---|---|\n|**Mean F1 Score**| [0.83842795 0.82335766 0.83083512 0.83543392 0.83062477]|\n|**General Mean F1 Score**| 0.8317|\n|**F1 Score Standard Deviation**| 0.0051|\n\n#### Visualizations\n![roccurve](doc/img/plot/rocauc.png)\n\n![precisionxrecall](doc/img/plot/precisionxrecall.png)\n\n![cf](doc/img//plot/cf.png)\n\n## Tools \n![Jupyter Notebook](https://img.shields.io/badge/jupyter-%23FA0F00.svg?style=for-the-badge\u0026logo=jupyter\u0026logoColor=white)![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54)![Visual Studio Code](https://img.shields.io/badge/Visual%20Studio%20Code-0078d7.svg?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white)\n\n## Contact\n- **E-mail**: andreluizlcons@gmail.com\n- **LinkedIn**: https://www.linkedin.com/in/andreluizls1/\n- **Phone** +55 88 999934237","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatalopes1%2Fhotel_reservations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatalopes1%2Fhotel_reservations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatalopes1%2Fhotel_reservations/lists"}