Predictive Modeling of Customer Bookings
By Caecilia A Rahman
Click here to see the Jupyter Notebook
TABLE OF CONTENTS
FEATURE IMPORTANT
EXPLORATORY DATA
PRINCIPAL COMPONENT ANALYSIS
RANDOM FOREST CLASSIFIER
& LOGISTIC REGRESSION
RESULT
03
01
02
04
05
to identify and prioritize the most relevant features in a dataset.
inspecting, cleaning and preprocessing the data
To reduce unnecessary variable(s).
Create model that fits the most based on data
Defining a model that fits data based on the evaluation
DATA
The data given is customer booking, we will create a model to predict the customer completed the booking based on their search and other attributes associated with that user event.
01 | EXPLORATORY DATA
Inspecting Data
Conduct an exploration of the data with the objective of ascertaining the variables present within the dataset.
Pre processing Data
Converting the contents of a string variable into float format in order to facilitate its processing.
02 | PRINCIPAL COMPONENT ANALYSIS
Principal component analysis (PCA) is a popular technique for analyzing large datasets containing a high number of dimensions/features per observation, increasing the interpretability of data while preserving the maximum amount of information, and enabling the visualization of multidimensional data.
It can be observed from the graph that the % Variance Explained increases as the 11 variables are included, therefore we will be utilizing the 11 variables
03 | FEATURE IMPORTANCE
Here's the variables:
num_passengers (f0), sales_channel (f1), trip_type (f2), purchase_lead (f3), length_of_stay (f4), flight_hour (f5), flight_day (f6), wants_extra_baggage (f7), wants_preferred_seat (f8), wants_in_flight_meals (f9), and flight_duration f(10).
We can see that the plot shows f3 (purchase_lead) has the highest importance and f(2) trip_type has the lowest importance.
as we can see, the accuracy is still high if we keep all the 11 variables just like PCA, so it is better to keep the 11 variables
04 | RANDOM FOREST CLASSIFIER &
LOGISTIC REGRESSION
A random forest is a meta estimator that fits a number of decision tree classifiers on various sub-samples of the dataset and uses averaging to improve the predictive accuracy and control over-fitting.
04 | RANDOM FOREST CLASSIFIER &
LOGISTIC REGRESSION
Logistic regression is modelling the probability of a discrete outcome given an input variable. The most common logistic regression model is a binary outcome. In this case, it’s booking completed by customer (0) if the customer didn’t complete the booking process and (1) if the customer completed the booking process
05 | RESULT