본문 바로가기

Data Analysis/Kaggle

[Kaggle] Hotel Booking Demand 데이터셋 분석 1 (데이터 확인 / 질문)

728x90

Hotel Booking Demand 데이터셋 분석

데이터셋 개요 : 도시 및 리조트 호텔의 예약정보 데이터

분석 목적 : 호텔 객실 예약 및 취소에 대한 정보 분석

데이터셋 출처 : https://www.kaggle.com/jessemostipak/hotel-booking-demand

 

Hotel booking demand

From the paper: hotel booking demand datasets

www.kaggle.com


1. 데이터 확인

# 기본 패키지 불러오기

import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use("seaborn") 
sns.set(font_scale = 1)
sns.set_style("whitegrid")

import plotly.express as px

import chart_studio.plotly as py
import cufflinks as cf
cf.go_offline(connected=True)

import plotly.graph_objects as go
import plotly.offline as pyo
pyo.init_notebook_mode()

from plotly.subplots import make_subplots

import missingno as msno

import warnings # 경고 메세지 숨기기
warnings.filterwarnings(action='ignore')

# plt.rc("font", family = "AppleGothic") # 한글 폰트 가져오기(Mac)
plt.rcParams['font.family'] = 'S-Core Dream'# 한글 폰트 가져오기(Win)

plt.rcParams['axes.unicode_minus'] = False # - 기호 깨짐 해결

 

# 데이터 불러오기

hotel = pd.read_csv("data/hotel_bookings.csv")

print(hotel.shape)
hotel.head()

<컬럼 설명>
- hotel: 호텔 종류
- is_canceled: 캔슬 여부 (1: yes / 0: no)
- lead_time: 예약한 날짜와 호텔에 도착 한 날짜 사이의 경과일
- arrival_date_year: 호텔 도착 연도
- arrival_date_month: 호텔 도착 월
- arrival_date_week_number: 호텔 도착 주
- arrival_date_day_of_month: 호텔 도착 일
- stays_in_weekend_nights: 주말 숙박 일수 (토요일,일요일)
- stays_in_week_nights: 평일 숙박 일수
- adults: 성인 인원 수
- children: 아동/청소년 인원 수
- babies: 유아 인원 수
- meal: 식사 예약 종류
- country : 호텔 위치 국가
- market_segment: 마켓 구분(TA: Travel Agent / TO: Tour Operators)
- distribution_channel: 예약 채널(TA: Travel Agent / TO: Tour Operators)
- is_repeated_guest: 재방문 고객 여부(1: yes / 0: no)
- previous_cancellations: 이번 예약 전에 고객이 취소한 예약 수
- previous_bookings_not_canceled: 이번 예약 전에 고객이 취소하지 않은 예약 수
- reserved_room_type: 예약 객실 타입
- assigned_room_type: 배정된 객실 타입
- booking_changes: 예약 후 예약 변경/수정 횟수
- deposit_type: 보증금 타입
- agent: 예약 에이전트(ID 로 대체)
- company: 예약 회사명(ID 로 대체)
- days_in_waiting_list: 예약 확정 전까지 대기 명단에 있었던 기간
- customer_type: 고객 유형
- adr: 평균 일일 숙박비
- required_car_parking_spaces: 주차 공간을 요구하는 차량 대수
- total_of_special_requests: 특별한 요청 수
- reservation_status: 마지막 예약 상태
- reservation_status_date: 마지막 예약 상태가 설정된 일자

 

 

# 데이터 정보 확인

hotel.info()

 

 

# 수치형 데이터 확인

hotel.describe()

 

 

# 범주형 데이터 확인

hotel.describe(include = np.object_)

 

 

# 결측치 확인

hotel.isnull().sum()

 

 

# 결측치 시각화

msno.bar(hotel)

대부분의 결측치가 company 컬럼에 있습니다.

 

 

# 데이터 내용 간단히 정리

print("총 데이터 수:", hotel.shape[0] * hotel.shape[1])
print("총 결측치 수: {}, 총 데이터의 {:.2f}%".format(hotel.isnull().sum().sum(), (hotel.isnull().sum().sum()*100) / (hotel.shape[0] * hotel.shape[1])))
print("호텔 방문 건수: ", len(hotel[hotel["is_canceled"] == 0]))
print("예약 취소 건수: ", len(hotel[hotel["is_canceled"] == 1]))


2. 질문하기

1) 호텔 종류와 예약 취소와의 관계는?  
2) 리드 타임과 예약 취소와의 관계는?  
3) 언제 방문을 가장 많이 할까?  
4) 언제 예약 취소를 가장 많이 할까?    
5) 호텔에 얼마나 숙박을 할까?  
6) 호텔에 숙박하는 가족 수는 얼마나 될까?  
7) 호텔 식사 예약 비율은?  
8) 호텔에 가장 많이 방문하는 고객의 국가와 가장 많이 취소하는 고객의 국가는?   
9) 가장 많이 예약하는 세그먼트와 가장 많이 취소하는 세그먼트는?  
10) 재 방문 여부와 예약 취소와의 관계는?  
11) 예약 객실과 배정된 객실이 동일할까?  
12) 예약 후 변경한 횟수가 얼마나 될까? 
13) 보증금과 예약 취소와의 관계는?   
14) 고객 유형과 예약 취소와의 관계는?   
15) 평균 일일 숙박비와 예약 취소와의 관계는?   

728x90