Next Article in Journal
Development of Machine Learning Algorithms for Application in Major Performance Enhancement in the Selective Catalytic Reduction (SCR) System
Previous Article in Journal
Changes of Macrobenthic Diversity and Functional Groups in Saltmarsh Habitat under Different Seasons and Climatic Variables from a Subtropical Coast
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

ERF-XGB: Ensemble Random Forest-Based XG Boost for Accurate Prediction and Classification of E-Commerce Product Review

by
Daniyal M. Alghazzawi
,
Anser Ghazal Ali Alquraishee
,
Sahar K. Badri
and
Syed Hamid Hasan
*
Department of Information Systems, College of Computer Sciences and Information Technology, King Abdulaziz University, Jeddah 80200, Saudi Arabia
*
Author to whom correspondence should be addressed.
Sustainability 2023, 15(9), 7076; https://doi.org/10.3390/su15097076
Submission received: 8 February 2023 / Revised: 11 April 2023 / Accepted: 12 April 2023 / Published: 23 April 2023

Abstract

:
Recently, the concept of e-commerce product review evaluation has become a research topic of significant interest in sentiment analysis. The sentiment polarity estimation of product reviews is a great way to obtain a buyer’s opinion on products. It offers significant advantages for online shopping customers to evaluate the service and product qualities of the purchased products. However, the issues related to polysemy, disambiguation, and word dimension mapping create prediction problems in analyzing online reviews. In order to address such issues and enhance the sentiment polarity classification, this paper proposes a new sentiment analysis model, the Ensemble Random Forest-based XG boost (ERF-XGB) approach, for the accurate binary classification of online e-commerce product review sentiments. Two different Internet Movie Database (IMDB) datasets and the Chinese Emotional Corpus (ChnSentiCorp) dataset are used for estimating online reviews. First, the datasets are preprocessed through tokenization, lemmatization, and stemming operations. The Harris hawk optimization (HHO) algorithm selects two datasets’ corresponding features. Finally, the sentiments from online reviews are classified into positive and negative categories regarding the proposed ERF-XGB approach. Hyperparameter tuning is used to find the optimal parameter values that improve the performance of the proposed ERF-XGB algorithm. The performance of the proposed ERF-XGB approach is analyzed using evaluation indicators, namely accuracy, recall, precision, and F1-score, for different existing approaches. Compared with the existing method, the proposed ERF-XGB approach effectively predicts sentiments of online product reviews with an accuracy rate of about 98.7% for the ChnSentiCorp dataset and 98.2% for the IMDB dataset.

1. Introduction

Nowadays, online shopping is a popular worldwide practice. Around 2 billion people use online shopping sites to purchase daily products. Customers usually buy products based on previous reviews in order to find better products [1]. The modern life of an individual is highly comfortable due to the advanced development of e-commerce. People can gather the needed products online without walking outdoors. Food delivery platforms have 70% more customers compared to other online delivery platforms. Uber Eats, Eat, and Grubhub are some of the fast-developing companies, with total transaction amounts of up to USD 94 billion. Choosing products by reading through many reviews can be tiresome. After the products are delivered to the clients, they usually share their opinion, comments, and positive and negative reviews on the Internet site [2]. Online shopping accounted for 14.1% of purchases in 2019 and is estimated to reach 22% in 2023. The products sold on online platforms need physical delivery, except for digital products. Compared to other methods, physical delivery causes more pollution, and the products delivered can be highly damaged. The delivery of satisfactory products will improve the reviews of the customer. The reviews provided by the customer help both the company and another customer. The reviews are obtained as a platform to overcome all the issues and make it easy to evaluate positive and negative reviews from the customers and the company [3]. The development of e-commerce is mainly focused on two factors: transaction volume prediction and e-commerce index construction. Utilizing the machine learning model results in excellent nonlinear mapping ability, a simple iterative process, and strong generalization ability. Sentiment analysis is the natural language processing used to sort emotions from opinions, text, and tweets, similar to text mining. The three concepts that comprise sentiment analysis are popularity, opinion, and the subject [4]. Delaying the delivery of the ordered product will create a bad review from an individual customer, and in business, this affects the customer’s retention rate. Trackable delivery products are delayed due to a lag in the shipment service. Popularity is defined by the negative and positive reviews. Opinion represents personal opinions. The subject represents the starting point of an opinion about an object [5]. An increase in the number of e-commerce platforms has generated significant financial transactions and increased fraud among users. E-commerce transaction volume prediction models, such as machine learning and statistical regression, have been conceived. The XG boost model is used to predict the transaction volume of e-commerce to protect the nonlinear part of online delivery. This contextual mining type helps extract and identify the subjective data to understand their social sentiment. This type of usage of e-commerce sites also impacts businesses greatly [6]. In addition, sentiment analysis contains lexical-based and machine learning approaches. The automated system also uses machine learning techniques to develop the hybrid model for sentiment analysis [7]. The machine learning approaches represent customer behavior using the plot’s accurate visual representation [8]. Thus, the visual representation details are gathered from the overall consumer behavior on the e-commerce platform [9]. In addition, customer reviews may enhance the hit ratio, increase customer visits, and increase spending time on e-commerce sites [10]. They can also apply the voice of customers for customer services and target marketing [11]. Internet technology is the mainstream vehicle for the development of online shopping. The objective of online shopping is to buy and consume things satisfactorily. The satisfaction of consumers mainly depends on the sentimental analysis (SA) of a sufficient number of user reviews. Yet, there are challenges in accepting the reviews due to text length, unfaithful logic, and sequence length. Online shopping has been growing exponentially in recent years, resulting in increased environmental impacts from packaging, transportation, and production. Moreover, socially responsible consumers are increasingly demanding information on the sustainability credentials of the products they buy. Hence, sentiment analysis of e-commerce product reviews plays a crucial role in informing sustainable consumer decisions. The proposed ERF-XGB approach provides an accurate and efficient method for predicting the sentiment polarity of product reviews, allowing customers to make informed decisions about the service and product qualities of the purchased products. By promoting informed purchasing decisions, the proposed approach may indirectly contribute to sustainability efforts by guiding consumers toward more sustainable choices. Moreover, the proposed approach has potential applications in analyzing sustainability-related reviews, such as reviews of sustainable or eco-friendly products. By accurately classifying sentiment polarity in these reviews, the proposed approach helps to identify areas for improvement and guide sustainability efforts. In this paper, a novel sentiment analysis approach is designed to predict the sentiments of product reviews more precisely. The main contributions of this paper are discussed as follows:
  • A new ensemble random forest-based XG boost (ERF-XGB) approach is proposed for the accurate and effective prediction and classification of sentiments of online reviews into two categories: positive and negative.
  • Selection of more relevant feature information from preprocessed datasets using the Harris hawk optimization (HHO) algorithm.
  • Analyzing the proposed ERF-XGB approach performances in terms of evaluation indicators: accuracy, recall, precision, and F1-score.
The remaining sections of this article are organized in the following ways: Section 2 deliberates on some recent literary works, Section 3 illustrates the proposed sentiment analysis methodology designed for predicting the sentiments of online product reviews, Section 4 portrays the experimental results, and, finally, Section 5 concludes the paper with its future scope.

2. Literature Survey

Zhao et al. [12] discussed the sentiment analysis of e-commerce products using machine learning techniques. A machine learning algorithm called LSIBA-ENN (Local Search Improvised Bat Algorithm-based Elman Neural Network) technique was obtained, which examined the differences obtained from online products. The presentation of the established technique was compared with some techniques such as NB, ENN, and SVM. As a result, the accuracy obtained for the established method was 93.91%. On the other hand, it provided less accuracy when applied to data from other domains, such as social media. Xu et al. [13] developed sentiment analysis in e-commerce using the naïve Bayes learning framework. The continuous naïve Bayes learning (CNBL) framework was deployed on more than two e-commerce products, which analyzed the sentiment categorization. The naïve Bayes enlarged the framework procedure, which resulted in a stable learning method and kept the increased efficiency. As a result, the products from Amazon as well as the appraisal obtained from the presented film improved the learning skill of the current domain and increased its capacity. However, the obtained results were wrong in some cases and therefore difficult to analyze.
Kumar et al. [14] illustrated that sentiment analysis and EEG identified customer gratification in product reviews. The recorded details collected from customers were recovered and the ratings were calculated by using the NLP technique. EEG signals display the product details in real time on the computer screen. Based on the values displayed on the screen, the local ratings were calculated easily and their report was obtained. The total presentation was improved by merging the local and global ratings based on the Artificial ABC algorithm. As a result, the established ABC method minimized the RMSE value compared to the unique model, and the rating was obtained as 0.29. On the other hand, the accuracy of the optimal value could not be achieved correctly in some cases. Parimala et al. [15] reviewed tweets for risk assessment in sentiment analysis using deep learning. The established RASA (Risk Assessment Sentiment Analysis) technique was applied and it identified clue words from the network, while the LSTM network categorized the tweet and sentiment analysis in each location. The developed technique was supported by different methods such as XG boost, naïve Bayes algorithm, SVM, multi-class, and dual class. As a result, the explained RASA technique obtained the dual scheme with a better accuracy rate of 1% when compared with XG boost, and in a multi-class scheme, it was obtained as 30% when related to other methods. However, the unique network performance was not processed with this method, and it was only operated for English. Ramshankar et al. [16] illustrated a novel system of fuzzy aiding using Black Hole-based Grey Wolf Optimization. A novel technique called BH-GWO was established, which obtained a coherent approval system. The mass of the product was efficiently obtained by the BH-GWO method. Finally, the sentiment analysis was determined using the diverse machine learning algorithm dataset. As a result, the BH-GWO system obtained 11.7% higher accuracy compared with fuzzy, 28.3% higher compared with KNN, 20.2% higher compared with SVM, and 18.75% higher compared with a neural network. On the other hand, the convergence speed was reduced. Gu et al. [17] discussed sentiment analysis in a deep neural network with a variational information bottleneck. The technique MBGCV was applied, which diminished the issues obtained in the network and achieved a satisfactory accuracy rate. The MBGCV technique utilized more than two channels and combined them with various methods. The developed model helped the traders examine the reviews from the customers and helped to improve the products. As a result, the established technique attained a better accuracy of 94%, and the obtained sentiment analysis performance was better as well. Meanwhile, only limited reviews were collected in sentiment analysis.
Munna et al. [18] proposed two deep learning NLP models: one is sentiment analysis, and the other is product review classification aimed at improving the quality and services. They used several evaluation matrices such as accuracy, precision, recall, and F1-score. The experimental results demonstrate a high accuracy: 0.84 and 0.69 for sentiment analysis and product review classification, respectively. Xu et al. [19] proposed a continuous naïve Bayes learning framework for product review sentiment classification of largescale and multi-domain e-commerce platforms. The standard machine learning algorithms for sentiment classification are typically trained based on a single task or single domain basis. However, reviews in e-commerce platforms come from a large number of different domains. Experimental results on the Amazon product and movie review sentiment datasets show that our model can use knowledge learned from past domains to guide learning in new domains and can handle continuously updated reviews from different domains.
Alzahrani et al. [20] proposed a framework to use an opinion on consumers’ reviews to help businesses and organizations continually improve their market strategies and obtain an in-depth analysis of the consumers’ opinions regarding their products and brands. The long short-term memory (LSTM) and deep learning convolutional neural network integrated with LSTM (CNN-LSTM) models were used. The LSTM and CNN-LSTM algorithms achieved 94% and 91% accuracy, respectively. The test result shows the deep learning techniques used here to provide optimal results for classifying customers’ sentiments toward the products. Huang et al. [21] developed a sentiment analysis model ERNIE-BiLSTM-Att (EBLA) to solve dimension mapping, disambiguation of sentiment words, and polysemy of Chinese words. The Attention Mechanism (Att) is used to optimize the weight of the hidden layer. Finally, softmax is used as the output layer for sentiment classification. The proposed model achieves an accuracy of more than 0.87 when compared to the existing one. Zhang et al. [22] propose a model to discover the helpfulness of online product reviews. Product reviews can be analyzed and ranked by our scoring system, and the reviews that may better help consumers than others will be found first. The experimental results confirm that our approach outperforms or performs the same as other machine learning methods.

3. Proposed Methodology

This paper proposes a novel ERF-based XG boost method for SA of online product reviews. The work of the proposed SA consists of three phases: data processing, feature selection, and sentiment classification, which are portrayed in Figure 1. The proposed model is mainly adopted for binary classification, and it classifies the e-commerce reviews into positive and negative opinions.

3.1. Data Preprocessing

The preprocessing approach is utilized for ignoring the undesirable elements from the set of databases. Three steps execute the preprocessing, and they are tokenization, Gensim lemmatization (GL), and snowball stemming (SBS).

3.1.1. Tokenization

This process encounters the whitespace character and breaks the input customer reviews into tokens or terms. The word sequences are analyzed to interpret their meaning [23].

3.1.2. Lemmatization

The groups of possible relations are determined by utilizing a morphological analysis process based on the multidimensional set. Then, it is utilized to solve problems in multi-dimension. Special characters, numeric removal, lower casing, and stand-alone punctuation are disparate operations in the Gensim package [24].

3.1.3. Stemming

During stemming, the smaller numbers of characters are neglected from the words by utilizing the stemming process. The lemmatization approach converts the words into a meaningful form without eliminating any characters [25].

3.2. Feature Selection

The insignificant features present in the data can decrease the accuracy of the design as well as make the model unable to studying the insignificant features. Then, the feature selection difficulties are developed as an optimization problem for detecting the informative features. The Harris hawk optimization (HHO) is the optimization technique for executing the feature selection, and it is described in the below section.
  • Harris Hawk optimization (HHO)
One of the population-based gradients-free optimizations is the HHO and it is utilized for solving optimization issues. The exploitation and exploration phases are inspired by the exploration of surprise pounce prey and various attacking methods of HH [26,27].
T β + 1 = { T ϑ β d 1 | T ϑ β 2 d 2 T β | ( T R A B β T v β ) d 3 ( Ρ r + d 4 ( u B l B ) )
From the above equation, Z β + 1 indicates the hawk’s position, β denotes the next iteration value, the current position of hawks is represented by T R A B β , σ indicates the random assignment value, while u B and l B indicate the upper bound and lower bound, respectively. The Harris hawks detect and track the prey through their eyes, and the HH is the candidate solution.
X ( q + 1 ) = { X ( q ) γ 1 | X ( q ) 2 γ 2 X ( q ) | d 0.5 ( X R A B ( q ) X s ( q ) γ 3 ( l B + γ 4 ( u B l B ) ) ) d < 0.5
From the above equation, the hawk’s position vector is indicated by X ( q + 1 ) , the rabbit position is represented by X R A B ( q ) , and the hawk’s current position vector is represented by X ( q ) . The average positions of hawks are calculated, and this is expressed as
X s ( q ) = 1 N c = 1 N X c ( q )
T β + 1 = Δ T β W | C T R A B β T β |
T β + 1 = T R A B β W | Δ T β |
T β + 1 = { F i f C ( F ) < C ( T β ) X i f C ( F ) C ( T β )
F = T R A B β W | C T R A B β T Ν β |
The values of s and v are assigned to 0 and 1. The above equation Γ F represents the levy flight and the T N β value is determined in the exploration stage.

3.3. Sentiment Classification

This section illustrates the proposed ERF-based XGB approach for the efficient prediction and classification of online product reviews.

3.3.1. Ensemble Random Forest (ERF)

ERF works by generating multiple decision trees during regression and classification. The final results of the classification are intent on decision tree voting [28]. The random forest algorithm has no sensitivity for hyperparameter settings; therefore, with some small adjustments, it can be utilized for establishing an appropriate model. In the classification issues of the clustering and regressive analyses, the RF algorithm achieved better performance in solving the problem. In an ensemble random forest, every decision tree is generated individually with various bootstrap samples.
  • Steps for generating ERF
1.
Bagging: The random forest algorithm selects random samples to extract 2 3 from the initial training dataset t = { ( X 1 , Y 1 ) , ( X 2 , Y 2 ) ( X m , Y m ) } for establishing a training subset. For generating m decision trees, the bagging algorithm received m bootstrap sample sets. Unextracted data are called out-of-bad data (OOB). The calculation of the OOB is more capable compared with cross-validation. OOB contains two-phase to extract the RF feature importance, such as the Gini index and OOB error rate. In the OOB error rate, the phase calculates the decision tree and the Gini index phase calculates the failed classification.
G i m = C = 1 C P C ( 1 P C ) = 1 C = 1 C P c 2
The above equation m represents the total number of nodes, P C indicates the class probability, and C represents the total number of classes.
The feature importance X j scenario is represented as follows:
V m J M G I N I = G i M G i L G i R
From the above equation, after splitting, the right and left nodes of the Gini index are represented by G i L , G i R .
2.
Decision tree construction: From m bootstrap sample sets, m classification trees are generated. The feature vector samples are represented by m . In m feature vectors, the original decision tree chooses the optimal feature vector. The results of the classification m can finally be received from m decision tree models.
y = { Y 1 ( X ) , Y 2 ( X ) , Y m ( X ) }
From the above equation, the classification model y with m the decision tree models are determined. The result of the final classification is determined by the multiple classification models.
t ( X ) = A r g M a x I 1 m Z ( Y I ( X ) ) = A
From the above equation, the fault class block is represented by A , the multiple classification models, and is denoted by t ( X ) , while the distinct decision tree model classification is represented by Y I ( X ) . If the indicator function Z ( . ) value is 1, then the two values are equal. Otherwise, the indicator function value is zero. To enhance the decision-making performance of the ensemble random forest (ERF) algorithm, the XG boost approach is integrated and hence the proposed ERF-XGB approach achieves the efficient detection of sentiments.

3.3.2. XG Boost (XGB) Algorithm

XG-boost is a widespread end-to-end and scalable tree-boosting model. It has been employed and optimized mostly in research, and it is the enhanced structure of the gradient boosting regression model (GBRT) [29,30,31]. GBRT contains a sequence of fundamental regression trees by way of the sequential technique and accommodates multiple trees to enlarge model ability. For this, the expression of the final prediction is formulated below.
x n = x n 1 + β g n ( Y , ϕ n ) = β i = 1 n g i ( Y , ϕ i )
The above equation ϕ i represents the parameter restraining tree structure, n represents the number of regression trees, g i ( Y , ϕ i ) represents i as the regression trees’ output based on ϕ i th the structure Y represents the predictor, and β represents the shrinkage factor, wherein Y predictors x x n 1 are inputs. The main goal of the gradient boosting regression is identifying the optimal φ i constructing g i ( Y , ϕ i ) i th step to decrease the function of the objective as expressed below.
M = j m ( x j , x j ) = j m [ x j i 1 + β g i ( Y j , ϕ i ) , x j ]
The above equation m represents a loss function that utilizes squared error between ground truth x and predictive value x .
Figure 2 represents the flow diagram of the proposed ERF-XGB approach below. The input dataset is selected randomly and the ensemble RF and XGB parameters are initialized for bootstrap sampling. An RF- classifier is constructed and trained for each instance using majority voting. The capability of the model is improved using more instances via XG boost. If the minimum loss value is not obtained, the model is trained again until the loss value is minimized. The ERF-XGB model predicts the polarity of the input as negative or positive.
Let us rewrite Equation (13) into the below equation.
M = j m ( x j , x j ) + i φ ( ϕ i ) = j m [ x j i 1 + β g i ( Y j , ϕ i ) , x j ] + i φ ( ϕ i )
The above equation φ ( ϕ i ) represents the regularization item on the i th regression tree for the prevention of overfitting.
φ ( ϕ i ) = δ S i + 1 2 υ u l = δ S i + 1 2 υ l = 1 S i [ u l ( i ) ] 2
The above equation S i represents the number of leaves in i th the tree, δ represents minimum loss reduction, υ denotes regularization term on the leaves’ weight, and u l ( i ) represents the i th and l th regression tree. It is evident that δ penalizes S i for decreasing the objective function. Figure 2 describes the flow diagram of the proposed ERF-XGB approach.

4. Experimental Results and Discussions

The ensemble random forest-based extreme gradient boosting (ERF-XGB) algorithm is proposed for the sentimental analysis of e-commerce product reviews. The experimental results are briefly explained in upcoming sections.

4.1. Experimental Setup

The experiments of this proposed ERF-XGB algorithm were conducted on the MATLAB 2019b platform along with the TensorFlow framework at PyCharm IDE and Python 3.5.

4.2. Dataset Description

Two types of datasets are used to effectively analyze the sentimental analysis of the proposed ERF-XGB algorithm. One of the datasets is the Internet Movie Database (IMDB) [32] dataset which has 25,000 tweets along with the polarity of 12,500 negative movie reviews and 12,500 positive movie reviews. The second dataset is the Chinese Emotional Corpus (ChnSentiCorp) dataset (https://github.com/hidadeng/cnsenti) which includes abundant Sentiment Corpus such as ChnSentiCorpMov and ChnSentiCorpHtl.The datasets are split into two types testing and training phases. Where the training phase contains 70% of the data, and the training phase contains 30% of the data. We provide a set of 25,000 highly polar movie reviews for training and 25,000 for testing. So, predict the number of positive and negative reviews using either classification or deep learning algorithms.

4.3. Performance Measures

The performance evaluation was performed by using performance metrics such as the accuracy ( C a c c u r a c y ), precision ( C p r e c i s i o n ), recall ( C r e c a l l ), and F1-score ( C F 1 s c o r e ), which are evaluated in terms of true positive ( C t r u e p o s i t i v e ), true negative ( C t r u e n e g a t i v e ), false positive ( C f a l s e p o s i t i v e ), and false negative ( C f a l s e n e g a t i v e ).
C a c c u r a c y = C t r u e p o s i t i v e + C t r u e n e g a t i v e C t r u e p o s i t i v e + C t r u e n e g a t i v e + C f a l s e p o s i t i v e + C f a l s e n e g a t i v e
C p r e c i s i o n = C t r u e p o s i t i v e C t r u e p o s i t i v e + C f a l s e p o s i t i v e
C r e c a l l = C t r u e p o s i t i v e C t r u e p o s i t i v e + C f a l s e n e g a t i v e
C F 1 s c o r e = 2 C p r e c i s i o n C r e c a l l C p r e c i s i o n + C r e c a l l

4.4. Hyperparameter Configuration

Hyperparameter tuning was used to find the optimal parameter values that improve the performance of the proposed ERF-XGB algorithm. Table 1 presents the optimized XG boost hyperparameter values.

4.5. Performance Analysis

Performance analysis of the ERF-XGB algorithm was conducted with respect to the metrics of accuracy, precision, recall, and F1-score. The overall performance analysis of the proposed ERF-XGB algorithm was compared with the standard XG boost, and the results are tabulated in Table 2.

4.6. Comparative Analysis

For comparative analysis, the methods namely Local Search Improvised Bat Algorithm based Elman Neural Network (LSIBA-ENN) model, Continuous Naïve Bayes Learning (CNBL) framework, Hybrid Black Hole based Grey Wolf Optimization (BH-GWO), Sentiment Lexicon Convolutional Neural Network with Attention-based Bidirectional Gated Recurrent Unit (SLCABG) model and proposed ERF-XGB algorithm are used. Figure 3a–d represents the Comparative analysis of accuracy, precision, recall, and F1-score for the ChnSentiCorp dataset. The comparative analysis is performed by using different methods such as LSIBA-ENN, CNBL, BH-GWO, SLCABG, and the proposed ERF-XGB algorithm. From this analysis, the proposed ERF-XGB algorithm achieved good performance for the sentimental analysis from e-commerce product reviews. Figure 3a denotes the accuracy analysis which depicts the better performance of the proposed ERF-XGB algorithm compared to other state-of-the-art methods. The accuracy rate of 78%, 86%, 83%, 90%, and 98.2% are achieved from the various methods like LSIBA-ENN, CNBL, BH-GWO, SLCABG, and proposed ERF-XGB algorithm respectively. Figure 3b shows the precision analysis that denotes the higher precision rate of 98.5% from the proposed ERF-XGB algorithm. The Methods such as LSIBA-ENN, CNBL, BH-GWO, and SLCABG attained a precision rate of 89%, 83%, 86%, and 90% respectively. Figure 3c portrays the recall rate analysis that implies the high performance of the proposed ERF-XGB algorithm. The recall rate of 79%, 85%, 83%, 88%, and 98.8% are obtained from LSIBA-ENN, CNBL, BH-GWO, SLCABG, and the proposed ERF-XGB algorithm. Figure 3d shows the F1-score analysis and the methods such as LSIBA-ENN, CNBL, BH-GWO, SLCABG, and the proposed ERF-XGB algorithm provide the F1-score of 83%, 81%, 88%, and 92% and 98.1% respectively.
Figure 4a–d depicts the comparative analysis of accuracy, precision, recall, and F1-score for the IMDB dataset. The comparative analysis is performed by using different methods such as LSIBA-ENN, CNBL, BH-GWO, SLCABG, and the proposed ERF-XGB algorithm. The accuracy analysis is performed in Figure 4a and the proposed ERF-XGB algorithm achieved a higher accuracy rate of 98.7%. Figure 4b represents the precision analysis of different methods such as LSIBA-ENN, CNBL, BH-GWO, SLCABG, and the proposed ERF-XGB algorithm which gives the precision rate of 79%, 87%, 83%, 90%, and 98% respectively. The recall rate analysis is depicted in Figure 4c which shows the best performance of the proposed ERF-XGB algorithm. The recall rate of 83%, 78%, 81%, 88%, and 98.3% is obtained from the LSIBA-ENN model, CNBL framework, BH-GWO, SLCABG model, and proposed ERF-XGB algorithm respectively. Figure 4d portrays the F1-score analysis and the proposed ERF-XGB algorithm achieved a higher performance of 98.1% compared to other state-of-the-art methods. Figure 5 shows the performance analysis of accuracy for testing and validation for different iterations. The smoothing accuracy is obtained by applying a smoothing algorithm and the training accuracy is obtained for each mini-batch. The training is stopped when the network reaches a plateau and when there is no improvement noted in the accuracy.

5. Conclusions

In this paper, the ERF-XGB algorithm was proposed for the sentimental analysis of e-commerce product reviews. Two types of datasets were used to effectively analyze the sentimental analysis of the proposed ERF-XGB algorithm: the Internet Movie Database (IMDB) dataset and the Chinese Emotional Corpus (ChnSentiCorp) dataset. Hyperparameter tuning was used to find the optimal parameter values that improved the performance of the proposed ERF-XGB algorithm. For comparative analysis, the LSIBA-ENN model, CNBL framework, BH-GWO, SLCABG model, and proposed ERF-XGB algorithm were used. In the ChnSentiCorp dataset, the proposed ERF-XGB algorithm provided an accuracy of 98.2%, a precision of 98.5%, a recall of 98.8%, and an F1-score of 98.1%. In the IMDB dataset, the proposed ERF-XGB algorithm provided an accuracy of 98.7%, a precision of 98%, a recall of 98.3%, and an F1-score of 97.1%. The experimental results show that the proposed ERF-XGB algorithm attained better performance compared to the other state-of-the-art methods. The proposed ERF-XGB approach is effective in predicting the sentiments of online product reviews, with accuracy rates of about 98.7% for the ChnSentiCorp dataset and 96.2% for the IMDB dataset. In the future, the proposed ERF-XGB algorithm will be employed for processing and extracting complex semantic and syntactic features.

Author Contributions

Methodology, S.H.H.; Software, A.G.A.A.; Validation, S.K.B.; Resources, D.M.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Munna, M.H.; Rifat, M.R.I.; Badrudduza, A.S.M. Sentiment analysis and product review classification in e-commerce platform. In Proceedings of the 2020 23rd International Conference on Computer and Information Technology (ICCIT), Dhaka, Bangladesh, 19–21 December 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 1–6. [Google Scholar]
  2. Diwakar, D.; Kumar, R.; Gour, B.; Khan, A.U. Proposed machine learning classifier algorithm for sentiment analysis. In Proceedings of the 2019 Sixteenth International Conference on Wireless and Optical Communication Networks (WOCN), Bhopal, India, 19–21 December 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 1–6. [Google Scholar]
  3. Noor, A.; Islam, M. Sentiment Analysis for Women’s E-commerce Reviews using Machine Learning Algorithms. In Proceedings of the 2019 10th International Conference on Computing, Communication and Networking Technologies (ICCCNT), Kanpur, India, 6–8 July 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 1–6. [Google Scholar]
  4. Singh, S.N.; Sarraf, T. Sentiment analysis of a product based on user reviews using random forests algorithm. In Proceedings of the 2020 10th International Conference on Cloud Computing, Data Science & Engineering (Confluence), Noida, India, 29–31 January 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 112–116. [Google Scholar]
  5. Yi, S.; Liu, X. Machine learning based customer sentiment analysis for recommending shoppers, shops based on customers’ review. Complex Intell. Syst. 2020, 6, 621–634. [Google Scholar] [CrossRef]
  6. Hossain, M.S.; Rahman, M.F.; Uddin, M.K.; Hossain, M.K. Customer sentiment analysis and prediction of halal restaurants using machine learning approaches. J. Islam. Mark. 2022. ahead-of-print. [Google Scholar] [CrossRef]
  7. Karn, A.L.; Karna, R.K.; Kondamudi, B.R.; Bagale, G.; Pustokhin, D.A.; Pustokhina, I.V.; Sengan, S. Customer centric hybrid recommendation system for E-Commerce applications by integrating hybrid sentiment analysis. Electron. Commer. Res. 2022, 23, 279–314. [Google Scholar] [CrossRef]
  8. Shrirame, V.; Sabade, J.; Soneta, H.; Vijayalakshmi, M. Consumer Behavior Analytics using Machine Learning Algorithms. In Proceedings of the 2020 IEEE International Conference on Electronics, Computing and Communication Technologies (CONECCT), Bangalore, India, 2–4 July 2020; IEEE: Piscataway, NJ, USA, 2020; pp. 1–6. [Google Scholar]
  9. Mehraliyev, F.; Chan, I.C.C.; Kirilenko, A.P. Sentiment analysis in hospitality and tourism: A thematic and methodological review. Int. J. Contemp. Hosp. Manag. 2022, 34, 46–77. [Google Scholar] [CrossRef]
  10. Li, H.; Bruce, X.B.; Li, G.; Gao, H. Restaurant survival prediction using customer-generated content: An aspect-based sentiment analysis of online reviews. Tour. Manag. 2023, 96, 104707. [Google Scholar] [CrossRef]
  11. Verma, P.; Dumka, A.; Bhardwaj, A.; Ashok, A. Product Review-Based Customer Sentiment Analysis Using an Ensemble of mRMR and Forest Optimization Algorithm (FOA). Int. J. Appl. Metaheuristic Comput. 2022, 13, 1–21. [Google Scholar] [CrossRef]
  12. Zhao, H.; Liu, Z.; Yao, X.; Yang, Q. A machine learning-based sentiment analysis of online product reviews with a novel term weighting and feature selection approach. Inf. Process. Manag. 2021, 58, 102656. [Google Scholar] [CrossRef]
  13. Xu, F.; Pan, Z.; Xia, R. E-commerce product review sentiment classification based on a naïve Bayes continuous learning framework. Inf. Process. Manag. 2020, 57, 102221. [Google Scholar] [CrossRef]
  14. Kumar, S.; Yadava, M.; Roy, P.P. Fusion of EEG response and sentiment analysis of products review to predict customer satisfaction. Inf. Fusion 2019, 52, 41–52. [Google Scholar] [CrossRef]
  15. Parimala, M.; Swarna Priya, R.M.; Praveen Kumar Reddy, M.; Lal Chowdhary, C.; Kumar Poluru, R.; Khan, S. Spatiotemporal-based sentiment analysis on tweets for risk assessment of event using deep learning approach. Softw. Pract. Exp. 2021, 51, 550–570. [Google Scholar] [CrossRef]
  16. Ramshankar, N.; Joe Prathap, P.M. A novel recommendation system enabled by adaptive fuzzy aided sentiment classification for E-commerce sector using black hole-based grey wolf optimization. Sādhanā 2021, 46, 125. [Google Scholar] [CrossRef]
  17. Gu, T.; Xu, G.; Luo, J. Sentiment analysis via deep multichannel neural networks with variational information bottleneck. IEEE Access 2020, 8, 121014–121021. [Google Scholar] [CrossRef]
  18. Yang, L.; Li, Y.; Wang, J.; Sherratt, R.S. Sentiment analysis for E-commerce product reviews in Chinese based on sentiment lexicon and deep learning. IEEE Access 2020, 8, 23522–23530. [Google Scholar] [CrossRef]
  19. Zhao, W. Classification of Customer Reviews on E-commerce Platforms Based on Naive Bayesian Algorithm and Support Vector Machine. J. Phys. Conf. Ser. 2020, 1678, 012081. [Google Scholar] [CrossRef]
  20. Alzahrani, M.E.; Aldhyani, T.H.; Alsubari, S.N.; Althobaiti, M.M.; Fahad, A. Developing an intelligent system with deep learning algorithms for sentiment analysis of e-commerce product reviews. Comput. Intell. Neurosci. 2022, 2022, 3840071. [Google Scholar] [CrossRef]
  21. Huang, W.; Lin, M.; Wang, Y. Sentiment Analysis of Chinese E-Commerce Product Reviews Using ERNIE Word Embedding and Attention Mechanism. Appl. Sci. 2022, 12, 7182. [Google Scholar] [CrossRef]
  22. Zhang, R.; Tran, T.T. Helping e-commerce consumers make good purchase decisions: A user reviews-based approach. In E-Technologies: Innovation in an Open World, Proceedings of the 4th International Conference, MCETECH 2009, Ottawa, Canada, 4–6 May 2009; Springer: Berlin/Heidelberg, Germany, 2009; pp. 1–11. [Google Scholar]
  23. Garg, N.; Sharma, K. Text pre-processing of multilingual for sentiment analysis based on social network data. Int. J. Electr. Comput. Eng. 2022, 12, 776–784. [Google Scholar] [CrossRef]
  24. Kolajo, T.; Daramola, O.; Adebiyi, A.; Seth, A. A framework for pre-processing of social media feeds based on integrated local knowledge base. Inf. Process. Manag. 2020, 57, 102348. [Google Scholar] [CrossRef]
  25. Nafis, N.S.M.; Awang, S. The impact of pre-processing and feature selection on text classification. In Advances in Electronics Engineering, Proceedings of the ICCEE 2019, Kuala Lumpur, Malaysia, 29–30 April 2019; Springer: Singapore, 2020; pp. 269–280. [Google Scholar]
  26. Heidari, A.A.; Mirjalili, S.; Faris, H.; Aljarah, I.; Mafarja, M.; Chen, H. Harris hawks optimization: Algorithm and applications. Future Gener. Comput. Syst. 2019, 97, 849–872. [Google Scholar] [CrossRef]
  27. Alabool, H.M.; Alarabiat, D.; Abualigah, L.; Heidari, A.A. Harris hawks optimization: A comprehensive review of recent variants and applications. Neural Comput. Appl. 2021, 33, 8939–8980. [Google Scholar] [CrossRef]
  28. Zhou, X.; Xu, X.; Zhang, J.; Wang, L.; Wang, D.; Zhang, P. Fault diagnosis of silage harvester based on a modified random forest. In Information Processing in Agriculture; Elsevier: Amsterdam, The Netherlands, 2022. [Google Scholar]
  29. Zhu, X.; Chu, J.; Wang, K.; Wu, S.; Yan, W.; Chiam, K. Prediction of rockhead using a hybrid N-XGBoost machine learning framework. J. Rock Mech. Geotech. Eng. 2021, 13, 1231–1245. [Google Scholar] [CrossRef]
  30. Luan, Y.; Lin, S. Research on text classification based on CNN and LSTM. In Proceedings of the 2019 IEEE International Conference on Artificial Intelligence and Computer Applications (ICAICA), Dalian, China, 29–31 March 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 352–355. [Google Scholar]
  31. Maas, A.; Daly, R.E.; Pham, P.T.; Huang, D.; Ng, A.Y.; Potts, C. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, Portland, OR, USA, 19–24 June 2011; pp. 142–150. [Google Scholar]
  32. Maas, A. Large Movie Review Dataset. Sentiment Analysis. Available online: https://ai.stanford.edu/~amaas/data/sentiment (accessed on 6 March 2023).
Figure 1. Proposed sentiment analysis architecture.
Figure 1. Proposed sentiment analysis architecture.
Sustainability 15 07076 g001
Figure 2. Flow diagram of proposed ERF-XGB approach.
Figure 2. Flow diagram of proposed ERF-XGB approach.
Sustainability 15 07076 g002
Figure 3. Comparative analysis using the ChnSentiCorp dataset (a) accuracy (b) precision (c) recall (d) F1-score.
Figure 3. Comparative analysis using the ChnSentiCorp dataset (a) accuracy (b) precision (c) recall (d) F1-score.
Sustainability 15 07076 g003
Figure 4. Comparative analysis of IMDB dataset. (a) accuracy (b) precision (c) recall (d) F1-score.
Figure 4. Comparative analysis of IMDB dataset. (a) accuracy (b) precision (c) recall (d) F1-score.
Sustainability 15 07076 g004
Figure 5. Performance analysis of accuracy for testing and validation for different iterations.
Figure 5. Performance analysis of accuracy for testing and validation for different iterations.
Sustainability 15 07076 g005
Table 1. Optimized XGB parameters using the ERF algorithm.
Table 1. Optimized XGB parameters using the ERF algorithm.
ParametersValue
Base LearnerTree
Gamma0
Learning rate0.03
Number of pruning after control0.2
RegularizationL2
Tree depth4
Random sampling decision tree ratio0.7
Minimum leaf node sample weight2
Table 2. Overall performance analysis of the proposed ERF-XGB algorithm.
Table 2. Overall performance analysis of the proposed ERF-XGB algorithm.
Sl. NoPerformance MeasuresPerformance Ranges
Proposed ERF-XGBXG Boost [24]
IMDB DatasetChnSenti Corp DatasetIMDB DatasetChnSenti Corp Dataset
1Accuracy 98.2%98.7%90.1%90.7%
2Precision98.5%98%89.3%88.6%
3Recall98.8%98.3%89.4%89.3%
4F1-score 98.1%97.1%89.0%88.1%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Alghazzawi, D.M.; Alquraishee, A.G.A.; Badri, S.K.; Hasan, S.H. ERF-XGB: Ensemble Random Forest-Based XG Boost for Accurate Prediction and Classification of E-Commerce Product Review. Sustainability 2023, 15, 7076. https://doi.org/10.3390/su15097076

AMA Style

Alghazzawi DM, Alquraishee AGA, Badri SK, Hasan SH. ERF-XGB: Ensemble Random Forest-Based XG Boost for Accurate Prediction and Classification of E-Commerce Product Review. Sustainability. 2023; 15(9):7076. https://doi.org/10.3390/su15097076

Chicago/Turabian Style

Alghazzawi, Daniyal M., Anser Ghazal Ali Alquraishee, Sahar K. Badri, and Syed Hamid Hasan. 2023. "ERF-XGB: Ensemble Random Forest-Based XG Boost for Accurate Prediction and Classification of E-Commerce Product Review" Sustainability 15, no. 9: 7076. https://doi.org/10.3390/su15097076

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop