数据来源:kaggle
本文源码及数据链接:百度云提取码:2vng

本文通过Python进行数据清洗,正文中使用Tableau作图进行展示。


项目背景

你有没有想过一年中预订酒店房间的最佳时间是什么时候?或者为了获得最佳的每日费用而选择的最佳停留时间?如果你想预测一家酒店是否有可能收到过高数量的特别要求呢?
这个酒店预订数据集可以帮助您探索这些问题!
该数据集包含城市酒店和度假酒店的预订信息,包括预订时间、入住时间、成人、儿童和/或婴儿数量以及可用停车位数量等信息。
数据来源于Nuno Antonio、Ana Almeida和Luis Nunes撰写的文章《酒店预订需求数据集》(Hotel Booking Demand Datasets),简明扼要,第22卷,2019年2月。
这些数据是由托马斯·莫克和安托万·比查特在2020年2月11日这一周的第三天下载和清理的。

确认目标

分析角度:

  1. 酒店运营角度

    1. 预定入住率、预定取消率、复订率、客户结构、预定房型、预定均价
    2. 押金、分房、客流量趋势
    3. 渠道质量、订单占比
  2. 用户画像
    1. 提前预定时长、预定入住月份、入住人数、出行结构、入住时长、复订间隔、餐饮预定
    2. 预定修改次数、用户类型

提出问题:

  1. 对用户来说,一年中预订酒店房间的最佳时间是什么时候?
  2. 如何提高酒店营收?
  3. 预测一家酒店的预订单是否会被取消。(待更新)

数据概览

字段 定义
hotel Hotel (H1 = Resort Hotel or H2 = City Hotel)
is_canceled Value indicating if the booking was canceled (1) or not (0)
lead_time Number of days that elapsed between the entering date of the booking into the PMS and the arrival date
arrival_date_year Year of arrival date
arrival_date_month Month of arrival date
arrival_date_week_number Week number of year for arrival date
arrival_date_day_of_month Day of arrival date
stays_in_weekend_nights Number of weekend nights (Saturday or Sunday) the guest stayed or booked to stay at the hotel
stays_in_week_nights Number of week nights (Monday to Friday) the guest stayed or booked to stay at the hotel
adults Number of adults
children Number of children
babies Number of babies
meal 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 Country of origin. Categories are represented in the ISO 3155–3:2013 format
market_segment Market segment designation. In categories, the term “TA” means “Travel Agents” and “TO” means “Tour Operators”
distribution_channel Booking distribution channel. The term “TA” means “Travel Agents” and “TO” means “Tour Operators”
is_repeated_guest Value indicating if the booking name was from a repeated guest (1) or not (0)
previous_cancellations Number of previous bookings that were cancelled by the customer prior to the current booking
previous_bookings_not_canceled Number of previous bookings not cancelled by the customer prior to the current booking
reserved_room_type Code of room type reserved. Code is presented instead of designation for anonymity reasons.
assigned_room_type 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 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 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 ID of the travel agency that made the booking
company 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 Number of days the booking was in the waiting list before it was confirmed to the customer
customer_type 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 Average Daily Rate as defined by dividing the sum of all lodging transactions by the total number of staying nights
required_car_parking_spaces Number of car parking spaces required by the customer
total_of_special_requests Number of special requests made by the customer (e.g. twin bed or high floor)
reservation_status 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 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

描述性分析

首先使用pandas_profiling输出描述性报告。

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
import pandas_profiling
# 忽略错误警告
warnings.filterwarnings('ignore')
# 解决matplotlib中文乱码
plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']
plt.rcParams['axes.unicode_minus'] = False
# 导入数据
data = pd.read_csv("./hotel_bookings.csv")
# 使用pandas_profiling输出描述性报告
pandas_profiling.ProfileReport(data).to_file("./report.html")


根据报告概述我们可以发现这份数据总共32个维度,119390行,其中有3.4%的单元格数据缺失,重复行为26.8%(考虑到这份数据没有订单ID,既没有主键,所以暂认为这些重复是正常的)。

根据图形来看,company,agent,country,children四列都存在缺失值,其中company缺失最严重。考虑删除。

  1. adr,adults,babies,booking_changes,children,days_in_waiting_list,lead_time(好多好多)存在离群值值。
  2. 旅客预订酒店的日期在月内基本持平,月末预定量稍大一些。
  3. 27-33周的酒店预订量较大,估计在6-8月是酒店客流量高峰期。
  4. 该组数据中2016年酒店预定量最大。
  5. 绝大部分的预订酒店用户没有带上宝宝或儿童,没有修改过预定要求,都是新客户,不需要停车位。
  6. 未取消的订单较取消订单多。
  7. 提前预定时间成明显的右偏。

数据清洗

  1. 根据报告看存在31994行重复行,占比26.8%,暂不删除。
  2. children(<0.1%),country(0.1%),agent(13.7%),company(94.3%)都存在缺失值
    1. children这里是携带孩童的个数,是离散值,所以用众数填充
    2. country使用众数填充
    3. agent代表有无旅行社,填充0
    4. company缺失值过多,删除该列
  3. 替换Undefined为SC
  4. 人数为0的异常数据删除(adults+children+babies)
  5. 删除价格为负值的行
  6. 将英文月份转为数字,方便排序
  7. 将预定到店日期的三列合并成一列,将其和reservation_status_date都转为日期格式
# 删除company
data.drop("company", inplace=True, axis=1)# 填充children
data.children.fillna(data.children.mode()[0], inplace=True)# 填充cuntry
data.country.fillna(data.country.mode()[0], inplace=True)# agent填充0
data.agent.fillna(0, inplace=True)# 替换Undefined为SC
data.meal.replace("Undefined", 'SC', inplace=True)# 剔除adr即价格为负数的值
data.drop(data[data.adr < 0].index, inplace=True)# 人数为0的异常数据删除
data.drop(data[data.adults+data.children+data.babies == 0].index, inplace=True)# 将提前预定天数划分几个层次
data['lead_time_cut'] = pd.cut(data['lead_time'], bins=[-np.inf, 0, 7, 14, 30,60, 90, np.inf], labels=[0, '1-7', '8-14', '15-30', '31-60', '61-90', '90+'])# 替换英文月份
ordered_months = ["January", "February", "March", "April", "May", "June", "July", "August","September", "October", "November", "December"]
month_che = range(1, 13)data['arrival_date_month'] = data.arrival_date_month.map(dict(zip(ordered_months, month_che)))# 将到店时间的三列拼成一列日期类型
# 先将三列转为字符类型
data[['arrival_date_year','arrival_date_month','arrival_date_day_of_month']]=data[['arrival_date_year','arrival_date_month','arrival_date_day_of_month']].astype(str)
# 三列拼接成一列并转为日期类型
data['arrival_date']=pd.to_datetime(data.arrival_date_year+'/'+data.arrival_date_month+'/'+data.arrival_date_day_of_month)
# 删除原始数据中的三列,减少内存
data.drop(['arrival_date_year','arrival_date_month','arrival_date_day_of_month'],axis=1,inplace=True)# 修改日期类型
data['reservation_status_date']=pd.to_datetime(data.reservation_status_date)# 新增一列用户入住天数
data['check_in_days']=data.reservation_status_date-data.arrival_date

EDA

酒店预定情况

  1. 整体的酒店预约入住率为62.92%,预约取消率高达37.08%。酒店方需要考虑造成较高退订率的原因。
  2. 占比96.85%,虽然预定酒店不像在电商购物那样可以很容易做到做到重复购买预定,但酒店方在拉新的同时,可以应该关注老用户的留存问题。
  3. 66.41%的订单为预定城市酒店,33.59%的订单为预定度假酒店。人们更愿意选择预定城市酒店。

销售渠道


  1. 酒店预订的主要渠道是线上旅行社,其次是线下旅行社,线上旅行社均价是最高的。(从数据中我们不能得知是否是第三方平台发布租房信息,如果是第三方,那该均价中应该包括了平台手续费)
  2. 9号旅行社可能是旅游行业龙头,占整个预订单中的26.78%。13.66%的订单未通过代理进行预定。240哈旅行社的订单占6.03%。
  3. 酒店直售的订单占比虽然只有12.26%,但是均价几乎与线上旅行社价格持平。(谁不想多赚点)

酒店流量

  1. 每年的七八月份酒店预定均价都会上涨。第一第四季度的酒店预订均价都处于低位,主要是1月及11月,12月的均价会有小小的反弹。城市酒店的人均价格维持在69-139元,度假酒店的均价浮动较大。
  2. 城市酒店各月份的酒店预订量及入住人数都高于度假酒店。
  3. 春冬两季的酒店预订单及入住人数较少,订单入住在5月及8月达到两个高峰,而6-9月是酒店入住高峰期。

客房分配

  1. 从对角线颜色较深来看,酒店方尽量会按照客户预定要求对房型进行保留,但也存在预定超量或客户修改需求的情况,导致客户入住房型与预定不符的情况。
  2. G、H两类房型的交付匹配度较高,很可能是酒店方最希望客户预定的房型,可以赚取更多的毛利。
  3. A房型较低的交付匹配度很可能是酒店用来引流,性价比最高的房型。

最佳预定房型

  1. A房型的预定量占72.03%,均价较低,应证了上面的猜想,A房型是性价比最高的房型。
  2. H、G房型的均价最高同样也应证了猜想,酒店方希望用户预定这类房型以赚取更多利润。

用户预定情况

  1. 84.92%的预订单没有修改过预定要求,10.62%的预订单修改过一次预定要求。
  2. 42.87%预订单都是距今90天前下单的,当天预定的仅为5.25%,城市酒店提前三月的预订单占了29.48%。
  3. 77.37%的顾客会选择预定早餐。

用户入住情况

  1. 入住1-3天是用户最为常见的选择。
  2. 28.24%的用户会在周内住两晚,25.41%的用户会在周内住一晚。
  3. 43.54%的用户不会在周末过夜。
  4. 周二预定入住的订单最少,仅为11.72%,周五的预定入住订单最多,为16.44%。

用户类型

  1. 75.06的用户都是临时用户。
  2. 68.42%入住酒店的人员结构是2名成人,18.94%是一名成人,

交叉分析

  1. 根据仅有的3.15%的老客来看,预定入住率达到85.35%,度假酒店的重复订购率明显增多。
  2. 老客们更喜欢在一月二月入住度假酒店,或者10月入住城市酒店。
  3. 老客的获客渠道39.18%是合作关系,21.10%为直售。
  4. 62.68%的老客不通过旅行社,直接跟酒店方预定客房。
  5. 同样是选中老客,他们预定早餐的概率高达91.69%,且60.23%的老客都是单人入住。
  6. 37.61%的老客会在一周内预定,29.20%的老客会在当天预定入住,23.73%的老客会在周二入住。
  7. 44.38%的老客会在周内住一晚,68.43%的老客不会在周末留夜。

太多方面了,一一附图将篇幅过长,以附上源文件,各位若高兴可以下载使用。

总结

  1. 有合作关系的老客中93.81%会选择预定A房型,99.18%会选择预定早餐,周内的入住率明显高于周末,且多是一人入住,猜测是合作公司工作人员出差住房。
  2. 直接与酒店方联系预定和在线上线下旅行社预订酒店均价相差不大。老客直接向酒店预定的占比提高了11个百分点。
  3. 酒店房型过多,导致用户选择余地过多。77.37%的用户会订购早餐。九成以上用户都是临时用户。
  4. 度假酒店的均价波动幅度较大,1月及11月的价格最低。城市酒店的价格波动幅度较小,同样也是在第一及第四季度的价格稍低。
  5. 提前三个月以上预定的预订取消率高达58.58%。
  6. 周内的入住率要高于周末。入住高峰是周四及周五。

建议

酒店方

  1. 对于有合作公司的酒店来说,可以查阅该公司以往的预定记录,推测预定周期,定时发送优惠信息(推送含早单人套间)。度假酒店可以在一二月份向老客发送优惠套餐短信,城市酒店可以在十月向老客发送优惠套餐短信。
  2. 由于直售预定与第三方合作预定的均价相差不大,所以尽可能推广自家酒店的联系方式。减少使用第三方预定所产生的手续费。例如:用户入住或退房时主动递上酒店名片、室内动线设计上可以在用户必经之路增设显眼的酒店信息海报。
  3. 对于预订单一定要有专员跟踪,当出现提前多个月预定的订单时,需要人工确认提醒、定时提醒,以提高预定入住率。
  4. 推出含早餐客房套餐,提高该类型套餐的排名。推出周四周五限时套餐。

用户

  1. 无论是要入住城市酒店还是度假酒店,都可以考虑预定一月或十一月的客房。一季度和四季度都是预定均价最低的时段。如果需要入住,第一二四季度可以选择度假酒店,因为均价较城市酒店低。

    毕竟度假酒店的客流量受季节性因素影响很大

  2. 预定可选选项较多时,切记要看清有无默认选中的增值服务,例如:早餐。

机器学习部分待更新

数据分析7_酒店预定分析_kaggle入门相关推荐

  1. 数据分析6_视频游戏销售分析_kaggle入门

    视频游戏销售分析 数据来源 kaggle数据集链接,共16598条记录,1MB. 本项目源码及数据源,提取码zahu. 采用Python+Tableau进行数据处理及可视化展示. 为减少篇幅,会尽量减 ...

  2. 数据分析:基于随机森林(RFC)对酒店预订分析预测

    数据分析:基于随机森林(RFC)对酒店预订分析预测 文章目录 数据分析:基于随机森林(RFC)对酒店预订分析预测 1.前言 2.数据探索 3.数据可视化分析 3.1酒店预订量和取消量 3.2酒店各月份 ...

  3. 数据分析中,文本分析远比数值型分析重要!(上)

    温馨提示:本文是<数据分析中,文本分析远比数值型分析重要!>的上篇,聊的是文本分析的一些基本知识,下篇将以一个实际案例来聊聊基于大数据的文本分析是如何应用在商业场景中的,将于明天推送,敬请 ...

  4. 【数据运营】数据分析中,文本分析远比数值型分析重要!(下)

    本文是<数据分析中,文本分析远比数值型分析重要!>的下篇,以一个实际案例来聊文本分析在实际运营如何落地.行为脉络如下:先简要讲述文本分析的分支---情绪分析的基本原理,然后以亚马逊的Kin ...

  5. php酒店预定,php酒店查询预约系统

    php酒店查询预约系统用户分析 酒店预订系统主要是针对酒店预订工作而开发的应用软件.通常有系统管理员.酒店预订管理员和酒店客户三种用户,他们的使用权限如下: 系统管理员:对系统.数据库进行维护,主要对 ...

  6. 《数据分析思维》:分析方法与业务知识

    小飞象·读书会 生活从来不会刻意亏欠谁,它给你一块阴影,必会在不远处撒下阳光. 读书交流│3期 数据分析方法与业务知识 data analysis ●●●● 分享人:木兮 欢迎大家参加这次读书会的直播 ...

  7. 基于微信小程序的酒店预定管理系统 报告+PPT+项目前后台源码及数据库文件

    摘 要 随着Internet 爆炸式的发展,互联网技术在我们的生活中无处不在,扮演着重要的角色.自我国加入WTO以后,电子商务在国内也迅速的发展了起来,现在互联网上各种电子商务网站更是迅速的增长.网络 ...

  8. asp毕业设计——基于asp+sqlserver的酒店预定管理系统设计与实现(毕业论文+程序源码)——酒店预定管理系统

    基于asp+sqlserver的酒店预定管理系统设计与实现(毕业论文+程序源码) 大家好,今天给大家介绍基于asp+sqlserver的酒店预定管理系统设计与实现,文章末尾附有本毕业设计的论文和源码下 ...

  9. 数据分析-PART 7--数据分析工具网站书籍

    数据分析-PART0--数据分析综合 数据分析-PART1--数据获取和步骤 数据分析-PART2--10大数据分析模型 数据分析-PART3--数据分析常用指标 数据分析-PART4--数据分析方法 ...

最新文章

  1. 清华数为DWF低代码平台亮相2021全球数字经济大会
  2. LeetCode: 105. Construct Binary Tree from Preorder and Inorder Traversal
  3. SpringMVC入门案例细节分析
  4. mysql 终止 存储过程
  5. java实现表达式求值_如何编写一个高效的Java表达式求值程序
  6. 使用 Python 切割图片
  7. 通过ActionTrail监控AccessKey的使用
  8. B9.流行的框架与新技术
  9. LabVIEW视觉功能模块下载
  10. [毕业设计] 基于单片机的智能快递柜设计与实现 - stm32 物联网
  11. 云服务器防 DDoS 攻击的几种方法策略分享
  12. stm32——项目准备中keil、XCOM的安装与配置
  13. Word文档 回车符去除
  14. vue 项目中页面打印实现(去除页眉页脚)
  15. hd530黑苹果硬解_解决黑苹果HD3000核显 VGA和HDMI外接显示器无反应问题
  16. 肿瘤免疫新抗原鉴定(一)OptiType安装与运行
  17. stcoder Splatter Painting 记忆化搜索
  18. google earth engine随缘学习(十一)影像分割
  19. 大数据量下,身份证的查询优化
  20. 鸿蒙定时重启软件,电脑定时自动关机怎么设置?学到就是赚到,赶紧学学!

热门文章

  1. app、h5自定义取景框,调用摄像头内嵌到网页或app
  2. linux怎么验证tacacs认证,Tacacs+服务器部署
  3. XBoot前后端分离开发平台springboot 2.x iview admin vue 集成activiti工作流 模型设计器 动态数据权限 权限按钮显示 s...
  4. Vnode-Vdom-diff算法
  5. HarmonyOS:利用PopupDialog实现多选效果
  6. 商场积分体系设计 购物中心会员管理系统
  7. 51学习(1):vscode+platformIO 开发环境搭建
  8. 淘宝资深java技术专家整理分享java异步编程实战文档
  9. codeforces 700E
  10. cf700E. Cool Slogans