Customer Booking Prediction

🧳 Customer Booking Prediction
Project Type: Classification Model | Industry Focus: Travel & Hospitality | Tools Used: Python, Pandas, Scikit-learn, Matplotlib, LightGBM
🔍 Project Overview
Developed a machine learning model to predict whether a customer will complete a hotel booking. The model supports marketing teams in targeting likely bookers and minimizing abandoned reservation attempts.
🎯 Objectives
- Classify potential customers as bookers or non-bookers based on behavioral data
- Improve booking conversion rates through predictive insights
- Enable personalized marketing and dynamic pricing strategies
🧩 Dataset
- Source: Kaggle (Hotel Booking Demand Dataset)
- Features: Booking channel, number of adults/children, lead time, room type, previous cancellations, special requests, etc.
- Target: Booking status (1 = Booked, 0 = Not Booked)
🛠️ Techniques & Methodology
- Performed EDA and cleaned inconsistencies (e.g., null values, outliers)
- Feature engineering: calculated booking window, grouped customer types
- Trained models: Logistic Regression, Decision Trees, LightGBM
- Evaluated with metrics: Accuracy, Precision, Recall, AUC-ROC
🚀 Key Results
- LightGBM achieved the best performance with 90%+ accuracy and strong recall
- Lead time, number of special requests, and previous cancellations were top predictors
- Insights enabled segmentation of likely bookers for targeted follow-ups
💼 Business Impact
This solution helps hotel and travel platforms reduce cart abandonment, optimize promotional spending, and maximize revenue per user by anticipating customer behavior before conversion takes place.
Key Results
Achieved ~84% r2 Score with the RandomForestRegressor with skfold model. Identified that repayment history and credit utilization were the most influential features. Deployed the final model using Streamlit for an interactive credit risk scoring demo.
Code Snippet
import sweetviz
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import display
sns.set()
from sklearn.preprocessing import OrdinalEncoder
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import r2_score,mean_absolute_error,mean_squared_error
# Load the dataset
df=pd.read_csv('/content/drive/MyDrive/Colab Notebooks/customer_booking.csv', sep=',' , encoding='latin-1')
df.head()
# Preprocessing
encode=OrdinalEncoder()
df[['sales_channel', 'trip_type', 'flight_day', 'route', 'booking_origin']]=pd.DataFrame(encode.fit_transform(df.select_dtypes(include='object')),columns=['sales_channel', 'trip_type', 'flight_day', 'route', 'booking_origin'])
# Initialize and train the model
bagging = BaggingClassifier(n_jobs=-1)
extraTrees = ExtraTreesClassifier(max_depth=10, n_jobs=-1)
randomForest = RandomForestClassifier(n_jobs=-1)
histGradientBoosting = HistGradientBoostingClassifier()
XGB = XGBClassifier(n_jobs=-1)
model = StackingClassifier([
('bagging', bagging),
('extraTress', extraTrees),
('randomforest', randomForest),
('histGradientBoosting', histGradientBoosting),
('XGB', XGB)
], n_jobs=-1)
model=model.fit(x_train, y_train)
y_pred=model.predict(x_test)
# Evaluate the model
skf=StratifiedKFold(shuffle=True,n_splits=2, random_state=42)
for x_train_index,y_train_index in skf.split(x,y):
x_train_fold=x_train.iloc[x_train_index]
y_train_fold=y_train.iloc[y_train_index]
x_test_fold=x_train.iloc[x_train_index]
y_test_fold=y_train.iloc[y_train_index]



















