샘플프로젝트 숙박 예약 수요 분석
문제상황 시나리오 요약
: A호텔은 노쇼/취소 고객을 사전에 예측하여 운영 비용을 상황에 맞춰 조정하려고 한다.
| hotel | is_canceled | lead_time |
|---|
| 호텔명 | 취소여부 | 입실까지 남은일 |
| arrival_date_year | arrival_date_month | arrival_date_week_number |
|---|
| 년 | 월 | 일 |
| arrival_date_day_of_month | stays_in_weekend_nights | stays_in_weekday_nights |
|---|
| 일 | 주말여부 | 평일여부 |
| adults | children | babies | meal | country |
|---|
| 성인 | 어린이 | 영유아 | 식사 | 나라 |
| market_segment | distribution_channel |
|---|
| 예약유통채널상세 | 예약유통채널 |
| is_repeated_guest | previous_cancellations | previous_bookings_not_canceled |
|---|
| 기존고객여부 | 과거 취소한 예약수 | 과거 취소하지 않은 예약수 |
| reserved_room_type | assigned_room_type | booking_changes |
|---|
| 예약객식타입 | 배정된객실타입 | 예약변경횟수 |
| deposit_type | agent | company | days_in_waiting_list |
|---|
| 보증금여부 | 여행사ID | 예약지불회사 | 대기자 명단에 있었던 일수 |
| adr | required_car_parking_spaces | total_of_special_requests | reservation_status | reservation_status_date |
|---|
| 평균객실비용 | 요구주차대수 | 특별요청수 | 예약상태 | 예약상태업데이트날짜 |
Process 01 월 별 예약 수요 분석
Process 02 취소 / 노쇼 고객 분석
- 취소 및 노쇼 비율
- 취소 및 노쇼 고객 특성 분석
(1) 월에 따른 취소/노쇼율 비교 : catplot & dataframe
(2) 호텔 타입에 따른 취소/노쇼율 비교
(3) 주말 예약일수에 따른 취소/노쇼율 비교
(4) 객실 타입에 따른 취소/노쇼율 비교
(5) Lead time에 따른 취소/노쇼율 비교
Process 03 ML활용 취소 / 노쇼 고객 예측
-
Data 준비
(1) Feature와 Y값으로 데이터를 나눔 (categorical 변수는 encoding하기)
(2) Data set을 학습용 / 테스트용으로 나눔 (RandomForestClassifier 사용)
-
모델 학습 및 평가
(1) precision, recall, f1-score, support 값 및 roc score 확인
(2) FPR, TPR 값에 따라 ROC curve plot하기
-
중요 변수 파악
: Feature IMP 분석 후 중요변수 탐색
roc score 그래프는 공부가 좀더 필요한 것 같다. precision, recall 한번 더 복습하고나니 어느정도 정리가 되는 것 같다.
이 글은 제로베이스 데이터 분석 취업 스쿨의 강의 자료 일부를 발췌하여 작성되었습니다.