VIETNAM NATIONAL UNIVERSITY, HANOI INTERNATIONAL SCHOOL GRADUATION PROJECT PREDICT THE LIKELIHOOD OF CUSTOMERS MAKING ONLINE PURCHASES BASED ON INFORMATION ABOUT CUSTOMER BEHAVIOR Nguyen Lan Chi Hanoi - Year 2024 VIETNAM NATIONAL UNIVERSITY, HANOI INTERNATIONAL SCHOOL GRADUATION PROJECT PREDICT THE LIKELIHOOD OF CUSTOMERS MAKING ONLINE PURCHASES BASED ON INFORMATION ABOUT CUSTOMER BEHAVIOR SUPERVISOR: PhD. Tran Duc Quynh STUDENT: Nguyen Lan Chi STUDENT ID: 20070906 COHORT: BDA2020A SUBJECT CODE: INS4011 MAJOR: Business Data Analytics Hanoi - Year 2024 2 Acknowledgement I would like to express my deepest gratitude to Ph. Tran Duc Quynh for his invaluable guidance and unwavering support throughout my thesis journey. His patience, motivation, enthusiasm, and immense knowledge have been essential to my research and writing process.
His dedicated mentorship has played a pivotal role in shaping every phase of my work. I would also like to extend my heartfelt appreciation to the analysts and researchers who have contributed invaluable insights, data, and resources on the UC Irvine website to my thesis. Their comprehensive information has been crucial in enhancing the depth and breadth of my research, enabling me to develop a more robust and detailed analysis. Finally, I want to express my sincere thanks to all my friends who have supported me throughout this journey.
Whether through direct assistance or indirect encouragement, your unwavering support has been a cornerstone of my progress. I am truly thankful for the opportunity to learn and grow alongside such wonderful friends. Thank you sincerely. 3 Letter of Declaration I hereby declare that the Graduation Project, titled "Predict the Likelihood of Customers Making Online Purchases Based on Information about Customer Behavior" is the result of my own research and has not been previously published.
Throughout the project, I adhered strictly to research ethics. All findings and survey results presented are the outcome of my personal research efforts, and all references are properly cited as per guidelines. I take full responsibility for the accuracy of the numbers, data, and all other contents included in this graduation project. This internship report faithfully represents my work over the 16-week period.
Under the guidance of Ph. Tran Duc Quynh, I diligently and honestly completed my assigned tasks. I confirm that this report upholds all copyrights and contains no fraudulent or misleading information. If there is any instance of academic misconduct identified in this report, I accept full responsibility and am prepared to face the consequences as determined by the department, faculty, and school.
4 List of abbreviation Abbreviation Definition AUC Area Under the Curve KNN K-Nearest Neighbors MLP Multilayer Neural Network ROC Receiver Operating Characteristic Synthetic Minority Over-sampling SMOTE Technique SVM Support Vector Machine XGB Extreme Gradient Boosting 5 List of figures and table Table 2-The description of data .1- Compare SMOTE, RO and without SMOTE of 7 models .2- Compare SMOTE and RO of 8 models with article [2]………….53 Figure 3-Flowchart of Problem-solving Steps………………………………….1-Overview of Features in the Dataset .2-Revenue per Weekend .3-Revenue per Month .4-Revenue per VisiterType .6- Dashboard of overview of customer behavior and conversions .7- Dashboard of analyze conversion rate and revenue .8-ROC Curves of Classification Models using SMOTE………………31 Figure 4.9-ROC Curves of Classification Models without using SMOTE.38 6 Table of Contents Acknowledgement. 3 Letter of Declaration. 4 List of abbreviation. 5 List of figures and table.
9 Chapter 2: Problem statement and data. Results of models with SMOTE applied. Random Forest Classifier. Decision Tree Classifier.
Support Vector Machine (SVM) Classifier. Results of models without SMOTE applied. Random Forest Classifier. Decision Tree Classifier.
Support Vector Machine (SVM) Classifier. Compare each model of SMOTE and without SMOTE. Results of models with Random Oversampling applied. Random Forest Classifier.
Compare SMOTE, Random Oversampling and without SMOTE of 8 models. Compare SMOTE and Random Oversampling of 8 models with results of article [2]. 58 8 Chapter 1: Introduction The explosive growth of e-commerce over the past few years has created vast opportunities in the market. However, this growth has not been accompanied by a corresponding increase in conversion rates, where potential customers complete their purchases.
This discrepancy highlights the need for innovative solutions that can present customized promotions to online shoppers [1]. In physical retail environments, salespeople leverage their experience to offer personalized recommendations, significantly influencing customers' purchasing decisions. This personal touch leads to efficient use of time, higher purchase conversion rates, and increased sales [1]. Emulating this level of personalization and effectiveness in an online setting is a major challenge that e-commerce businesses face today.
To address this challenge, many e-commerce and IT companies are investing heavily in early detection and behavioral prediction systems. These systems aim to replicate the personalized experience provided by a human salesperson in a virtual shopping environment [2]. Alongside these industry efforts, academic research has also been exploring various approaches to predict user behavior and improve conversion rates through machine learning methods [2]. Some studies focus on categorizing user visits based on navigational patterns, while others aim to predict user behavior in real-time, enabling immediate actions to enhance shopping experiences and reduce cart abandonment [3].
This thesis proposes a system to predict the likelihood of customers making online purchases based on their behavioral data. The approach utilizes eight different machine learning models: Multilayer Perceptron (MLP), Support Vector Machine (SVM), k-Nearest Neighbors (k-NN), Decision Tree, Bagging, Random Forest, XGBoost, and AdaBoost. These models are evaluated for their effectiveness in predicting purchasing intentions and site abandonment using data from an online retailer [4]. Comparing these models aims to identify the most effective strategies for enhancing conversion rates and improving the overall customer experience.
Previous research has demonstrated the potential of various machine learning techniques in predicting online shopping behaviors. For instance, Moe (2003) 9 categorized user visits using k-means clustering, which helped in understanding different purchasing intentions based on navigational patterns. Mobasher et al. (2000) explored clustering models to enhance recommender systems, showing that user profiles extracted from clickstream data can significantly improve personalization at the early stages of user visits.
These studies underscore the importance of understanding user behavior to provide tailored experiences that can drive conversions. Building on these foundational studies, the approach integrates a comprehensive suite of machine learning models to predict purchasing behavior. This is motivated by the need for real-time, actionable insights that can significantly reduce shopping cart abandonment and increase purchase conversion rates [5]. For example, Suchacka and Chodak (2018) characterized e-customer behaviors based on session data, applying association rule mining to predict purchasing probability.
The choice of this topic—predicting the likelihood of customers making online purchases based on behavioral data—is driven by its significant implications for the e-commerce industry. Implementing such predictive models can lead to more effective marketing strategies, optimized resource allocation, and ultimately, higher revenue generation for online retailers [7]. The ability to anticipate and influence customer behavior in real-time represents a critical advancement in the ongoing evolution of e-commerce technology. By leveraging advanced models like Random Forest and XGBoost, which are known for their high predictive accuracy and robustness, aim to develop a system that not only predicts purchasing intention but also provides actionable insights to e- commerce platforms.
This system is expected to be crucial for personalizing user experiences and taking timely actions to retain potential customers, thereby enhancing the overall efficiency and effectiveness of online retail operations [8]. 10 Chapter 2: Problem statement and data This thesis focuses on predicting the likelihood of customers making online purchases based on their behavioral data on the website. In simple terms, we want to know what customers do on the website, what products they like, and what factors make them decide to buy or leave. To do this, we have data from 12,330 online shopping sessions, with 84.5% (10,422) labeled as negative class samples (did not result in a purchase) and the remaining 15.5% (1,908) labeled as positive class samples (resulted in a purchase) [2], including information about the time customers spend viewing each type of page (admin page, information page, product page,.), bounce rate, average value of pages viewed, time of purchase (weekday vs.
weekend, month), geographic region, device and browser type, and customer type (new vs old)[2]. However, the difficulty here is that the data is unbalanced, i. the number of non-buying customers is significantly more than the number of buying customers. To solve this problem, we will preprocess the data by handling missing values, converting categorical variables to numeric form, and normalizing the data.
Then, analyze the data using graphs and statistical methods to better understand the characteristics of the data. Next, we will use technique to create synthetic data samples, helping to balance the ratio between the two customer groups. Machine learning models such as Random Forest, MLP, XGBoost, KNN, Decision Tree, SVM, AdaBoost and Bagging are used to predict customer purchasing behavior. These models will be evaluated on both the original data and the data processed to find the best model.
11 Table 2-The description of data Role Type Description Variable name Number of admin-related Administrative Feature Integer pages visited Time spent on admin-related Administrative_Duration Feature Integer pages Number of informational Informational Feature Integer pages visited Time spent on informational Informational_Duration Feature Integer pages Number of informational ProductRelated Feature Integer pages visited Time spent on product-related ProductRelated_Duration Feature Continuous pages Rate of visitors bouncing from BounceRates Feature Continuous the first page Rate of visitors exiting from a ExitRates Feature Continuous specific page Average value of pages PageValues Feature Integer visited 12 Proximity to a special SpecialDay Feature Integer day/event Month Feature Month of the visit Categorical OperatingSystems Feature Integer Operating system of the user Browser Feature Integer Browser used by the user Region from which the user is Region Feature Integer visiting TrafficType Feature Integer Type of traffic source Type of visitor: new, VisitorType Feature Categorical returning, or other Representing whether the Weekend Feature Binary session is on a weekend. Representing whether or not Target Binary the user completed the Revenue purchase. An overview of the method In data classification, especially in the field of predicting online purchasing behavior, the problem of data imbalance is a common obstacle. Specifically in this context, the number of customers who do not make a purchase is often greater than the number of customers who make a purchase, making it difficult to build an accurate prediction model.
Therefore, this thesis applies two techniques to solve this data imbalance problem. SMOTE (Synthetic Minority Oversampling Technique) was the first technique used to solve this problem. SMOTE works by generating new synthetic data samples for the minority class (customer purchases) through interpolation between a randomly selected sample from the minority class and its nearest neighbors in the same class. This process is repeated until the number of samples in the minority class is balanced with the number of samples in the majority class (non-purchasing customers).
By applying SMOTE, the model's prediction performance is enhanced by providing it with more information about the minority class, allowing the model to learn important features of this class and reduce classification bias skewed towards the majority class. Random Oversampling (RO) is another technique used to handle data imbalance. This technique works by random sampling with replacements from the minority class and replicating these samples until the number of samples in the minority class is equal to the number of samples in the majority class. The advantage of RO is its simplicity and ease of implementation, but its disadvantage is that it can lead to overfitting, especially when the sample size of the minority class is small.
Both SMOTE and Random Oversampling are effective techniques to solve the problem of data imbalance, each with its approach. SMOTE creates new synthetic samples, while Random Oversampling simply copies existing samples from the minority layer. The choice of which technique to use depends on the characteristics of each specific data set and model.