© 2026 The authors. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).
OPEN ACCESS
Personalized marketing systems require reliable predictive components, but the suitability of conventional classifiers for structured recommendation-support tasks remains unclear. This study compares Decision Tree, Random Forest, K-Nearest Neighbors (KNN), and Gaussian Naïve Bayes for four-class book rating-category prediction using 11,127 Goodreads transaction records. The target categories were derived from average book ratings, whereas quantity and total price were used as input features after preprocessing; identifiers and the source rating variable were excluded from model training. Models were evaluated with a stratified 80:20 train-test split comprising 8,684 training and 2,171 test records. Performance was assessed using accuracy, precision, recall, F1-score, and area under the receiver operating characteristic curve. Under this experimental setting, the Decision Tree achieved the strongest results, with an accuracy of 0.9995, precision of 1.0000, recall of 0.9600, F1-score of 0.9800, and Area Under the Curve (AUC) of 0.9996. Random Forest showed comparable accuracy but lower recall and F1-score, whereas KNN performed less consistently and Naïve Bayes performed poorly. The results indicate that tree-based classifiers can separate the rating categories effectively within this low-dimensional, structured dataset. These findings should be interpreted as evidence for rating-category prediction rather than personalized recommendation effectiveness, because no individual user profiles, preference histories, ranking measures, or marketing outcomes were evaluated. Further work should test user-level recommendation data, ranking-based metrics, repeated validation, and broader baseline models.
Goodreads dataset, rating-category prediction, machine learning classification, Decision Tree, Random Forest, recommender systems, structured transaction data
Personalized marketing strategies aim to deliver innovation and relevance to each customer based on their data and behavior. With the help of AI, companies can efficiently analyze large amounts of data, understand individual preferences, and design marketing campaigns tailored to the needs and desires of each customer [1]. The application of artificial intelligence (AI) to customised marketing strategies is essential. AI-powered personalised marketing techniques can improve client acquisition and retention [2, 3] Customer conversion refers to the desired actions of customers, such as purchasing products or services, while customer retention refers to a company's ability to keep customers over time. Both aspects are vital for business growth and sustainability [4]. This study highlights the importance of personalization in modern marketing, as well as the objectives and benefits expected from this research. Additionally, the structure and methodology of the research used to achieve these objectives will be outlined [5]. By understanding and implementing AI-based personalized marketing strategies, companies are expected to achieve higher levels of customer conversion and retention, ultimately increasing business revenue and profit [6].
A subfield of computer science called AI concentrates on developing systems or machines that are able to mimic human abilities in thinking and performing tasks. In this context, AI is applied to marketing strategies to enhance customer loyalty [7]. AI's role enables assisting humans in voice recognition, for example, recommending products to customers. By utilizing machine learning (ML) algorithms, AI can examine customers' purchase history and browsing behavior to suggest the most relevant products, thereby enhancing the likelihood of customer purchases [8]. AI can also perform other tasks, working through algorithms and mathematical models designed to learn from data and experience, allowing machines to improve their performance over time. With AI, we can develop advanced applications such as virtual assistants, autonomous vehicles, recommendation systems, and various other innovations that make human life easier [9].
Sentiment analysis employs natural language processing, text analysis, computational linguistics, and biometrics to systematically identify, extract, quantify, and analyze emotional states and subjective data. This method is employed to comprehend and categorize emotions (positive, negative, and neutral) in text through text analysis techniques, frequently utilized on online platforms such as social media, e-commerce, and websites [10]. The alterations in customer purchasing behaviors throughout the pandemic have profoundly influenced the market; yet, employing sentiment analysis techniques can enhance sales for Micro, Small, and Medium Enterprises (MSMEs). This study seeks to analyze consumer reactions to the acquisition of MSME products in Karanganyar Regency. This technique operates by clustering existing data and processing it to generate the desired result to assist MSMEs in Karanganyar Regency [11].
Although artificial intelligence and ML have been widely applied to personalized marketing and recommendation systems, most existing studies focus on algorithm implementation or performance reporting in isolated scenarios rather than systematically comparing multiple classification models using real-world datasets to determine the relatively more suitable approach for personalized product recommendations. Additionally, previous research has often prioritized sentiment analysis, hybrid recommendation strategies, or collaborative filtering techniques, while limited attention has been given to evaluating classifier-based content-filtering models using measurable performance indicators such as precision, recall, F1-score, Area Under the Curve (AUC), and error rate [3, 12]. The absence of comparable empirical evidence generates ambiguity concerning whether ML approach provides the most dependability and practical applicability for automated personalization in e-commerce settings. This study seeks to address the research gap by assessing and contrasting the efficacy of Decision Tree, Random Forest, K-Nearest Neighbors (KNN), and Naïve Bayes classification models utilizing a real dataset, with the goal of determining the most precise and reliable algorithm to enhance personalized marketing decision-making and improve recommendation quality [13, 14].
Beyond algorithm comparison, this study positions the evaluated classification models as the predictive core of a recommendation-support module within a personalized marketing information system. In this framing, the recommendation output is not treated merely as a static classification result, but as decision-support information that can assist product targeting, prioritization, and operational personalization processes. This study enhances model evaluation and informs the design of intelligent decision-support components for AI-driven marketing workflows by integrating classification-based recommendations within a comprehensive information-system framework.
This research employs the Content-Based Filtering method, which does not require data from other users as a reference for recommendations [15]. Content-Based Filtering uses existing information within several items or data to determine appropriate recommendations for users [16, 17]. Content-Based Filtering determines recommendations based on the similarity level of one item to other items in the data. This method selects and ranks items based on the similarity of item attributes. This method's benefit is that users get info on items that matter to them, as each item's content can be known from its representation. Item attributes and descriptions are crucial in the filtering process of this method. Items with the highest similarity level to other candidate items will be recommended to users as recommendations [18].
In its implementation, content-based filtering uses vector calculations, Term Frequency-Inverse Document Frequency (TF-IDF), and cosine similarity, which essentially convert data into vector form. The development of recommendation systems aims to reduce excessive information by selecting the most relevant information from large data and providing a list of items that match the user's interests or preferences [19]. Recommendation systems can predict user preferences by analyzing the user's history or other users' history, which is a key feature of this system to generate recommendations that match each user's preferences [20]. Therefore, the findings of this study are expected to provide empirical guidance for both researchers and practitioners in selecting ML models that align effectively with data structure and operational needs in AI-driven marketing systems.
2.1 Personalized marketing and data-driven recommendation
The concept of personalized marketing has gained significant traction in recent years, driven by advancements in AI and big data analytics. Personalized marketing refers to strategies and techniques that leverage individual consumer data to deliver targeted and relevant marketing messages, thereby enhancing consumer engagement and satisfaction. Recent studies have highlighted the transformative role that AI-driven personalization plays in improving customer experiences. Specifically, AI technologies such as recommendation systems and dynamic content delivery allow marketers to tailor their offerings to meet specific consumer preferences, contributing to higher levels of customer engagement and satisfaction [21, 22]. Furthermore, the use of predictive analytics enables businesses to forecast customer behavior and create personalized interactions, facilitating a seamless integration of marketing strategies that resonate with individual consumer needs [23, 24].
The relationship between personalization, conversion, and retention is increasingly recognized as a crucial triad in modern marketing. Effective personalized strategies not only enhance the likelihood of conversion where potential customers complete a purchase but also contribute to long-term customer retention by fostering loyalty and satisfaction [25, 26]. Research indicates that customers who experience personalized marketing efforts demonstrate higher purchase intentions and are more likely to continue engaging with brands over time [27, 28]. Furthermore, the implementation of personalized marketing techniques has been shown to reduce acquisition costs while improving conversion rates by strategically targeting high-potential customer segments [29]. Thus, by strategically harnessing personalization, businesses can create a sustainable cycle of engagement that boosts both conversion rates and customer loyalty, leading to enhanced long-term profitability [16].
2.2 Artificial intelligence applications in E-commerce
The application of AI in e-commerce has seen remarkable advancements, particularly in the utilization of ML, natural language processing (NLP), and deep learning technologies to enhance recommendation systems. These systems play a pivotal role in personalizing user experiences by analyzing vast amounts of consumer data and extracting actionable insights about consumer preferences and behaviors [30, 31]. Techniques such as collaborative filtering and content-based filtering are fundamental in refining product suggestions, ensuring that consumers are presented with the most relevant options based on their past interactions and preferences [3, 27]. Furthermore, the integration of NLP allows for sentiment analysis, enabling businesses to gauge customer feedback effectively. This is crucial for aligning marketing strategies with consumer sentiments, thereby enhancing engagement and conversion rates [14, 32].
Previous studies have underscored the transformative potential of AI technologies in shaping e-commerce dynamics through improved customer profiling and sentiment awareness. Research indicates that AI-powered systems are proficient at understanding and predicting consumer behaviors, enabling more effective marketing tactics that resonate with targeted demographics [12, 33]. For instance, Raji et al. provided a comprehensive review of how AI-driven personalization approaches can significantly increase customer satisfaction and purchasing likelihood, further establishing a symbiotic relationship between engagement and sales [34]. Additionally, the ability to automate and optimize marketing campaigns through AI has led to increased operational efficiencies and enhanced customer service experiences via intelligent chatbots and virtual assistants [23, 35]. The interplay of these AI applications not only enhances individual customer interactions but also serves as a critical driver of business growth within the competitive e-commerce landscape [36].
2.3 Classification-based approaches for multi-class recommendation prediction
Classification-based multi-class prediction in recommender settings complements collaborative filtering and is typically more advantageous. Classic surveys and targeted studies show that recommender systems can be framed as classification problems, allowing discriminative models to assign items, users, or interactions to discrete classes (e.g., rating levels, popularity tiers, or item receptivity categories) rather than just predicting numeric ratings or generating ranked lists [37]. Early research explicitly classified recommender tasks as classification tasks and explored different model classes, finding that while some classifiers did not consistently outperform strong Collaborative Filtering (CF) baselines, classification approaches could improve quality competitively or in a complementary manner with content-based or hybrid strategies. Compound classification models and decision-tree–based formulations have been examined as alternatives or companions to memory- and model-based CF, demonstrating multiclass classification's potential in recommender settings [38]. In content-rich domains like movie popularity and audience targeting, multi-class classification has been explicitly studied using classifiers like Random Forests, Support Vector Machine (SVMs), and deep learning–based ensembles to predict discrete classes of interest (e.g., popularity tiers, engagement levels) in conjunction with content features [37, 39].
The literature also emphasizes the synergy between classification and hybrid filtering: sentiment-aware and feature-rich classification components can be fused with collaborative filtering to address cold-start and data-sparsity issues while improving explainability and transparency of recommendations [37, 40].
Importantly, reputable international journals illustrate that multi-class classification in Recommender Systems (RS) often involves explicit handling of class imbalances, ordinal versus nominal class structures, and evaluation via multiclass metrics, underscoring the need for careful methodological alignment with the domain (e.g., drug recommendations, news filtering, and consumer product domains) [41, 42]. Collectively, these findings support the view that, alongside collaborative filtering, classification-based approaches provide a rigorous, versatile, and evidence-backed pathway for multi-class prediction in modern recommender systems, particularly when integrated with content signals, context, and hybrid architectures to overcome inherent CF limitations [43].
Rethinking recommendation tasks beyond collaborative filtering relies on ML classifiers. Several international journals show how recommender problems can be cast as multi-class and multi-label classification problems, allowing discriminative models to assign items, users, or interactions to discrete classes like rating tiers, engagement levels, or receptivity categories instead of rating prediction or ranking. Classifier-enabled pipelines can outperform or complement CF baselines when integrated with content signals, contextual data, or hybrid filtering schemes, demonstrating the versatility and robustness of classification-based RS [43, 44]. Multi-class formulations, using one-vs-rest, one-vs-one, or hierarchical decomposition, effectively address real-world complexities like imbalanced classes, ordinal vs. nominal class structures, and domain-specific evaluation metrics [45]. Classifiers like Random Forests, Support Vector Machines, gradient boosting (e.g., XGBoost), and deep ensembles have been used to predict discrete classes of interest (e.g., popularity levels, article receptivity, or treatment regimens) using rich content features and contextual signals in movies, news, finance, and healthcare. According to Papadakis et al. [37], Yi and Liu [40], Daskalakis et al. [46], classification components can reduce cold-start and data sparsity by fusing content features, sentiment, and context with CF signals, making recommendations more transparent and explainable.
Many studies report competitive results, but some classifiers do not consistently outperform strong CF models on standard benchmarks, emphasizing the importance of task framing, class structure (ordinal vs. nominal), data balance, and domain-aligned evaluation. Thus, classifier-based approaches for multi-class prediction in modern RS are rigorous, flexible, and evidence-based, especially when embedded in hybrid architectures and informed by domain-specific challenges like imbalanced data and explainability requirements. These perspectives agree that classification-based multi-class techniques expand recommender system methodology and can benefit situations with rich characteristics, specific class aims, and interpretable decision support [41].
Despite growing evidence that classification-based approaches offer a robust pathway for multi-class prediction in recommender systems, existing studies predominantly emphasize hybrid architectures, collaborative filtering integration, or domain-specific applications rather than systematically comparing classifier performance in structured content-based recommendation settings [46, 47]. Moreover, limited research has examined how conventional classifiers such as Decision Tree, Random Forest, KNN, and Naïve Bayes perform under a unified multi-metric evaluation framework for discrete recommendation categories derived from structured transaction data [41, 48]. This gap is particularly important because model effectiveness in multi-class recommendation tasks is often contingent on the alignment between data structure, class formulation, and algorithmic characteristics. Therefore, this study addresses this empirical and methodological gap by benchmarking four classification algorithms within a content-based recommendation framework using a real-world Goodreads dataset to identify the most effective model for structured multi-class recommendation prediction.
The dataset used in this study was obtained from the Goodreads dataset available on Kaggle, consisting of 11,127 transaction records with structured attribute information, as presented in Table 1. Prior to model development, the dataset underwent a series of preprocessing steps, including verification of missing values (no missing data were identified), removal of non-informative identifier variables (id_order and product_id), and normalization of numerical features (quantity and total_price). In addition, the average_rating attribute was transformed into categorical class labels to support supervised classification. The dataset presented in Table 1 consists of selected transactional features used as input variables for classification, while the target variable was derived from the average_rating attribute. To enable supervised learning, the rating values were transformed into four categorical classes based on predefined thresholds representing different levels of product performance. These categories were designed to reflect practical marketing relevance, where higher-rated products indicate stronger customer satisfaction and higher potential for conversion and retention. To prevent information leakage, the average_rating variable was used exclusively for label construction and was not included among the input features during model training. Additionally, identifier variables were excluded to ensure that the models learned patterns from meaningful transactional attributes rather than indirect or non-informative signals [49].
Table 1. Goodreads dataset information
|
No. |
Variable Name |
Description |
Data Type |
Role |
Preprocessing |
|
1 |
id_order |
Unique identifier for each transaction |
Integer |
ID |
Not used in modeling |
|
2 |
product_id |
Unique identifier for each book |
String |
ID |
Not used in modeling |
|
3 |
quantity |
Number of books purchased in a transaction |
Integer |
Feature |
Normalized |
|
4 |
total_price |
Total transaction value |
Numeric |
Feature |
Normalized |
|
5 |
average_rating |
Average user rating of the book |
Numeric |
Label |
Categorized into 4 classes |
This study adopts a comparative experimental approach to evaluate the performance of four ML classification algorithms, namely Decision Tree, Random Forest, KNN, and Naïve Bayes, implemented using the Python programming environment. The objective is to identify the relatively more suitable model for predicting book recommendation categories based on user-related data [50]. The steps involved in data processing are as follows:
Selection Stage. This stage involves preparing the dataset for model development by selecting relevant data and partitioning it into training and testing sets. The dataset was divided using an 80:20 ratio, where 80% of the data were used for training and 20% for testing to evaluate model performance [51, 52].
Research Pre-Processing. The pre-processing stage began with checking the dataset for missing values. For the Goodreads-books dataset, no missing values were identified. Within this pre-processing stage, there are steps to create labels/classes and convert string attributes to numeric [53].
Within the content-based filtering framework, transactional item attributes such as quantity and total_price were used as structured input features to represent item content relevant to the recommendation process. These features underwent vector-based representation and similarity-oriented content processing to identify relevant item patterns, which subsequently served as input to the classification models (Decision Tree, Random Forest, KNN, and Naïve Bayes). In this workflow, the classification models function as the predictive layer that assigns items into recommendation categories, while the predicted categories constitute the recommendation output used to support decision-making in personalized marketing contexts.
Model Selection Stages. Decision Tree Algorithm originates from the Concept Learning System (CLS) and Iterative Dichotomiser 3 (ID3) algorithms. Decision Trees based on the C4.5 algorithm are a commonly used classification technique to extract relevant relationships in data [54]. The C4.5 algorithm is a program that constructs a decision tree based on labeled input data. Its advantage lies in its easily interpretable model that can handle both continuous and discrete attribute values. C4.5 algorithm divides training data using information gain. Attributes with high frequencies are considered to separate data based on available information in the dataset. Before calculating the gain value, first determine the entropy value using the following equation:
${Entropy}(S)=\sum_{i=1}^n p i * \log _2 p i$
${Gain}(S, A)={Entropy}(S)-\sum_{i=1}^n \frac{|S i|}{|S|} * {Entropy}(S i)$
The Decision Tree algorithm was implemented as one of the classification models in this study, utilizing a standard tree-based learning approach to identify patterns within the dataset. In addition to Decision Tree, three other classification algorithms—Random Forest, KNN, and Naïve Bayes—were also employed to enable a comprehensive comparative evaluation of model performance [55].
Table 2. Parameter settings used in the comparative classification models
|
Classifier |
Parameter Setting |
|
Decision Tree |
criterion = gini; max_depth = None |
|
Random Forest |
n_estimators = 100; criterion = gini |
|
K-Nearest Neighbors (KNN) |
n_neighbors = 5; metric = euclidean |
|
Naïve Bayes |
Gaussian Naïve Bayes (default settings) |
Model comparisons were conducted using parameter settings selected to ensure a fair and consistent evaluation across all classification algorithms. The parameter configuration used in each model is presented in Table 2.
Stages of evaluation and validation of results. In this stage, all classification models were evaluated to assess their predictive performance and enable comparative analysis. The dataset was partitioned using a stratified 80:20 train–test split, where 80% of the data were used for training and 20% for testing. This approach ensures that class distributions are preserved across both subsets, supporting a more reliable evaluation of model performance. The dataset was partitioned into training and testing sets using an 80:20 ratio, comprising 8,684 records for training and 2,171 records for testing. All classification models were trained on the training set and evaluated on the testing set to ensure an unbiased assessment of performance, with no overlap between training and testing data. Model evaluation was conducted using standard classification metrics, including accuracy, precision, recall, F1-score, and ROC/AUC, derived from the confusion matrix. To demonstrate the performance of the algorithm used, the equation is as follows:
$Accuracy$ $=\frac{T P+T N}{T P+F P+T N+F N} \times 100 \%$
The accuracy produced is calculated based on the confusion matrix. The calculations in the confusion matrix are computed according to true positive predictions (True Positive), false positive predictions (False Positive), true negative predictions (True Negative), and false negative predictions (False Negative). The higher the accuracy value obtained, the better the resulting method. Precision is the ratio of true positive predictions (TP) compared to the overall positive predictions.
$Precision$ $=\frac{T P}{T P+F P} \times 100 \%$
Recall is the ratio of TP compared to the total actual positives.
$Recall$ $=\frac{T P}{T P+F N} \times 100 \%$
F1-score is a weighted average of precision and recall.
$F 1-$$Score$ $=2 \times \frac{{Precision} \text { × } {Recall}}{({Precision} \text { + } {Recall})}$
Model performance was evaluated using standard classification metrics, including accuracy, precision, recall, F1-score, and ROC/AUC, derived from the confusion matrix. These metrics were used to assess the predictive capability of each model and to enable consistent and fair comparison across all evaluated algorithms, namely
At this stage it will be displayed in the form of tables and graphs for comparison of classification algorithms.
Based on research conducted on the Goodreads-books dataset using a percentage split_train_test (80%), one of the models to be used in this study is evaluating the accuracy results of the algorithm using 80% of the dataset, amounting to 8684 data for training, and 20% of the dataset, amounting to 2171 data for testing. This dataset consists of 12 attributes as input variables and RatingCategory as the output variable created from (average_rating) with preprocessing that results in 4 classes: Best Product, Good Product, Not-Bad Product, and Lowest Rated Product. The research findings will be elaborated and can be seen in more detail in Table 3 and will be displayed in the form of a histogram graph in Figure 1, as follows.
Table 3. Results of comparative research on classification algorithms
|
Classifier |
Accuracy |
Precision |
Recall |
F1-Score |
ROC/AUC |
MAE |
|
Decision Tree |
0.9995 |
1.0000 |
0.9600 |
0.9800 |
0.9996 |
0.05 |
|
Random Forest |
0.9991 |
1.0000 |
0.9200 |
0.9500 |
0.9993 |
0.09 |
|
K-Nearest Neighbors (KNN) |
0.9823 |
0.9600 |
0.8700 |
0.9130 |
0.9750 |
0.18 |
|
Naïve Bayes |
0.1096 |
0.1300 |
0.2200 |
0.0700 |
0.4064 |
101.89 |
Figure 1. Graph of research results comparing classification algorithms
The comparative results presented in Table 3 indicate that tree-based models, particularly Decision Tree and Random Forest, achieved the highest performance across all evaluation metrics, with Decision Tree demonstrating the best overall performance (accuracy = 0.9995, precision = 1.0000, recall = 0.9600, F1-score = 0.9800, ROC/AUC = 0.9996), followed by Random Forest with slightly lower recall and F1-score values, suggesting a minor trade-off in sensitivity. KNN achieved moderate performance (accuracy = 0.9823, precision = 0.9600, recall = 0.8700, F1-score = 0.9130, ROC/AUC = 0.9750), indicating reasonable classification capability but with limited generalization compared to tree-based approaches. In contrast, Naïve Bayes exhibited significantly lower performance across all metrics (accuracy = 0.1096, ROC/AUC = 0.4064), reflecting its limited capability in capturing the underlying data structure. These findings suggest that tree-based models are more effective in handling structured categorical data with potential feature dependencies, whereas instance-based and probabilistic approaches such as KNN and Naïve Bayes may struggle under such conditions.
Based on Figure 1, it can be concluded that the classification algorithm with the highest accuracy, precision, recall, F1-score, ROC/AUC is the Decision Tree Algorithm with the smallest Mean Absolute Error of 0.05. The higher the accuracy and AUC values, the higher the ability to recommend books based on book categories to users. The confusion matrix model will form a matrix consisting of true positives and true negatives. The confusion matrix results further strengthen this interpretation, indicating that Decision Tree and Random Forest models demonstrate strong sensitivity and specificity across all four rating categories, with misclassifications occurring minimally and only in adjacent product classes. In contrast, the Naïve Bayes model shows widespread misclassification across categories, signaling limited ability to differentiate product preference groups. This suggests that the dataset's feature relationships are non-linear and dependent, making probabilistic approaches unsuitable in this classification context. Below are the results of the confusion matrix for the Decision Tree, Random Forest, and Naïve Bayes classification algorithms.
Table 4. Confusion matrix of the decision tree and random forest
|
Model |
Actual Class → / Predicted ↓ |
Best Product |
Good Product |
Not-Bad Product |
Lowest Rated Product |
|
Decision Tree |
Best Product |
65 |
0 |
0 |
0 |
|
Good Product |
0 |
11,137 |
0 |
0 |
|
|
Not-Bad Product |
0 |
0 |
5 |
1 |
|
|
Lowest Rated Product |
0 |
0 |
0 |
963 |
|
|
Random Forest |
Best Product |
65 |
0 |
0 |
0 |
|
Good Product |
0 |
1,137 |
0 |
0 |
|
|
Not-Bad Product |
0 |
0 |
4 |
2 |
|
|
Lowest Rated Product |
0 |
0 |
0 |
963 |
The confusion matrix results provide further insight into the model classification behavior across the four rating categories (Table 4). The Decision Tree model demonstrates nearly perfect classification performance, correctly identifying all instances of Best Product, Good Product, and Lowest Rated Product, with only minor misclassification occurring within the Not-Bad Product category. Similarly, the Random Forest model also shows strong classification capability, although with slightly higher misclassification levels compared to Decision Tree, particularly in the Not-Bad Product class. These results highlight that both tree-based models exhibit high sensitivity and specificity across most categories, indicating their suitability for handling structured categorical datasets in recommendation system applications.
In contrast to the strong performance demonstrated by the Decision Tree and Random Forest algorithms, the KNN and Naïve Bayes models showed substantial classification challenges across all classes (Table 5). The confusion matrix for the KNN algorithm indicates widespread misclassification patterns, particularly in the Best Product and Good Product categories, where instances were frequently assigned to incorrect labels. For example, only a small portion of Best Product items were correctly classified, while a considerable number were incorrectly categorized into lower-ranked classes such as Good Product and Lowest Rated Product. This inconsistency suggests that the feature distribution within the dataset may not align well with the similarity-based distance computations used by KNN, leading to reduced discriminative capability when handling multi-class categorical data.
Table 5. Confusion matrix of the K-Nearest Neighbors (KNN) and Naïve Bayes
|
Model |
Actual Class → / Predicted ↓ |
Best Product |
Good Product |
Not-Bad Product |
Lowest Rated Product |
|
K-Nearest Neighbors (KNN) |
Best Product |
7 |
38 |
0 |
20 |
|
Good Product |
17 |
721 |
0 |
399 |
|
|
Not-Bad Product |
0 |
2 |
0 |
4 |
|
|
Lowest Rated Product |
5 |
452 |
0 |
506 |
|
|
Naïve Bayes |
Best Product |
0 |
6 |
59 |
0 |
|
Good Product |
2 |
234 |
901 |
0 |
|
|
Not-Bad Product |
0 |
2 |
4 |
0 |
|
|
Lowest Rated Product |
0 |
220 |
743 |
0 |
The performance limitations were even more pronounced in the Naïve Bayes model, which exhibited the highest misclassification rate among all evaluated algorithms. The confusion matrix reveals that the model struggled to correctly differentiate between product categories, with the majority of instances being assigned to the wrong class. This outcome reflects the inherent constraints of the Naïve Bayes approach, which assumes independence between features—a condition rarely met in real-world e-commerce data where user ratings, item attributes, and category indicators tend to be interdependent. As a result, the probabilistic assumptions underpinning the model failed to capture the underlying structure of the dataset, leading to significant prediction errors across all output labels.
Taken together, these confusion matrix results reinforce the earlier findings derived from performance metrics, demonstrating that KNN and Naïve Bayes are less suitable for this recommendation context compared to tree-based models. Their inability to reliably classify instances across all product rating categories indicate that the dataset's structure favors algorithms capable of modeling nonlinear relationships and hierarchical decision boundaries.
The combined confusion matrix results provide deeper insight into how each algorithm handles multi-class recommendation scenarios. Decision Tree demonstrates the highest level of consistency, with almost all samples accurately classified across the four product categories. This strong performance can be attributed to the structured nature of the dataset and the presence of discrete attribute patterns, which Decision Tree models are able to capture through hierarchical decision rules. In comparison, Random Forest also performs well but shows minor misclassification in the Not-Bad Product class. This slight performance gap is expected, as Random Forest aggregates multiple tree structures, potentially producing more conservative generalizations that influence recall values.
In contrast, both KNN and Naïve Bayes exhibit significant classification errors. KNN displays inconsistent performance across classes, particularly in the Best Product and Good Product categories, suggesting that distance-based similarity measures struggle to represent underlying feature relationships in this dataset. The Naïve Bayes model shows the weakest behavior, with widespread misclassification across nearly all categories, reflecting the limitations of its independence assumption when applied to structured e-commerce data where item attributes and rating distributions are interdependent. This misalignment is consistent with findings in prior AI-based recommendation system research, which has shown that tree-based classifiers tend to outperform probabilistic and distance-based methods when dealing with categorical consumer behavior patterns and multi-label classification.
Overall, the confusion matrix analysis reinforces the quantitative results reported earlier. The Decision Tree model not only achieves the highest accuracy, precision, recall, and ROC scores but also suggests strong real-world stability with minimal error patterns. These findings directly address the research objective of identifying the relatively more suitable ML model for personalized marketing recommendation systems. Accordingly, the Decision Tree algorithm can be considered the most reliable candidate for generating automated product suggestions and supporting targeted marketing strategies, making it highly applicable for improving customer conversion and retention in e-commerce environments.
The results of this study reinforce existing literature that highlights the growing influence of artificial intelligence and ML in improving personalized marketing and recommendation accuracy. Prior research indicates that AI-driven personalization enables companies to deliver more relevant product suggestions and increase engagement metrics such as click-through and conversion rates [56, 57], and the findings here are consistent with studies showing that targeted machine learning models outperform generic approaches when personalization is grounded in behavioral and preference-based data [58].
The notably high performance demonstrated in this study must be understood in the context of the dataset attributes and problem definition. The organized and comparatively low-dimensional feature space, along with the conversion of continuous rating values into distinctly defined categorical groups, probably led to well-defined decision boundaries that benefit tree-based algorithms. To assure the validity of these results, the target variable (average_rating) was solely utilized for label generation and excluded from the input features during model training, hence reducing the chance of information leaking. These findings indicate that although high predictive accuracy is attainable in structured datasets, the efficacy of the model is significantly contingent upon the congruence between data attributes and algorithmic design, necessitating caution when extrapolating these results to more intricate real-world recommendation contexts.
Similarly, Chabane et al. [59] emphasized that tailored algorithm selection significantly improves predictive performance in recommendation systems, a trend also reflected in this study where Decision Tree and Random Forest showed the strongest classification stability. The broader literature, including the bibliometric review by Bawack et al. [60], further supports the growing interdisciplinary relevance of AI-powered recommender systems within e-commerce, integrating insights from marketing, data science, and consumer psychology.
However, some contrast appears when compared with studies advocating alternative approaches such as hybrid recommendation strategies that combine collaborative filtering and content-based filtering to enhance prediction reliability and personalization depth [61]. Although these studies indicate robust performance from probabilistic and hybrid models, the current findings demonstrate that Naïve Bayes and KNN were significantly less effective, presumably due to the dataset's dependence structure and the relationships among categorical variables that contravene fundamental model assumptions. This divergence suggests that the effectiveness of recommendation models is not universal but dependent on the alignment between algorithm logic and dataset characteristics. Thus, this research advances prior work by demonstrating through empirical evidence that tree-based approaches, rather than probabilistic or similarity-driven methods, are better suited for structured categorical product-rating environments in personalized marketing contexts, highlighting model–data compatibility as a critical determinant of recommender system performance.
The findings of this study provide meaningful implications both theoretically and practically, reinforcing the growing body of evidence that ML models play a critical role in enhancing personalization accuracy within modern recommendation systems driven by artificial intelligence [56, 57]. Theoretically, the strong performance of Decision Tree contributes to ongoing discussions in AI-based marketing by demonstrating that algorithm suitability is highly dependent on dataset structure and feature dependency, supporting recent claims that tailored model selection often yields superior predictive outcomes compared to generalized or deep learning approaches applied without contextual alignment [58, 59]. Practically, the findings indicate that firms utilizing personalized marketing engines should prioritize interpretable and computationally efficient models, especially when dealing with datasets comprising categorical product features and rating categories. This study methodologically emphasizes the importance of empirical model comparison and multi-metric evaluation, consistent with recent studies advocating for more transparent benchmarking frameworks in the development of recommender systems [9, 60]. However, several limitations should be acknowledged, including reliance on a single dataset, the absence of hybrid or deep learning–based recommendation models such as collaborative filtering or neural recommenders, and the use of a single train–test validation split rather than multi-fold cross-validation. These limitations indicate that the comparative findings should be interpreted within the present experimental setting and should not be implicitly generalized beyond the structured recommendation context examined in this study. Additional research across diverse datasets, model variants, and validation strategies is needed to strengthen robustness, transferability, and broader empirical validation of model performance in recommendation contexts [16, 62]. Overall, this study contributes empirical evidence demonstrating that model–data alignment is a key determinant of effectiveness in AI-driven personalized marketing systems. By showing that tree-based models outperform probabilistic and similarity-based algorithms in structured categorical environments, the findings reinforce ongoing shifts toward context-aware ML in recommender system research and practice.
However, the exceptionally high predictive performance reported in this study should be interpreted in light of several characteristics of the experimental setting. The structured and relatively low-dimensional feature space, together with clearly defined categorical labels, may have contributed to simpler decision boundaries that favor tree-based models and support near-perfect classification outcomes. While these conditions strengthen performance within the present dataset, they may also limit generalizability to more complex real-world recommendation environments characterized by dynamic user behavior, noisier feature interactions, and less deterministic data structures. Therefore, the findings should be understood as strong evidence within a controlled structured-data context, while broader applicability requires further validation in more diverse and operational settings.
The study's findings indicate that the Decision Tree model demonstrated superior performance among the four classification algorithms assessed for structured multi-class recommendation prediction utilizing the Goodreads dataset, whereas Random Forest exhibited comparable efficacy, and KNN and Naïve Bayes displayed diminished suitability under identical data conditions. The results indicate that the efficacy of the model in this context is determined by the congruence between algorithmic attributes and organized feature representations, underscoring the significance of model-data compatibility in classification-oriented recommendation tasks. From an information-systems viewpoint, these findings suggest that tree-based models can function as a robust predictive foundation for a recommendation-support module aimed at facilitating decision-making in personalized marketing workflows. Nonetheless, these conclusions are confined to the current experimental context and should not be extrapolated beyond the variables explicitly investigated in this work. Future research may extend this work by testing similar models across alternative datasets, integrating more advanced recommendation architectures, and applying additional validation strategies to further assess the robustness, transferability, and decision-support potential of these findings.
[1] Necula, S., Păvăloaia, V. (2023). AI-driven recommendations: A systematic review of the state of the art in E-commerce. Applied Sciences, 13(9): 5531. https://doi.org/10.3390/app13095531
[2] Beyari, H., Hashem, T. (2025). The role of artificial intelligence in personalizing social media marketing strategies for enhanced customer experience. Behavioral Sciences, 15(5): 700. https://doi.org/10.3390/bs15050700
[3] Gaikwad, D., Ingale, P., Divekar, P., Changede, S., Bhuwad, S. (2024). AI enabled E-commerce platform. International Journal of Advanced Research in Science, Communication and Technology, 4(1): 123-128. https://doi.org/10.48175/ijarsct-22020
[4] Fillis, I., Wagner, B. (2005). E-business development. International Small Business Journal: Researching Entrepreneurship, 23(6): 604-634. https://doi.org/10.1177/0266242605057655
[5] Dewi, A.M.S.I., Dwidasmara, I.B.G. (2020). Implementation of the K-Nearest Neighbor (KNN) algorithm for classification of obesity levels. Jurnal Elektronik Ilmu Komputer Udayana, 9(2): 277. https://doi.org/10.24843/jlk.2020.v09.i02.p15
[6] Hardcastle, K., Vorster, L., Brown, D.M. (2025). Understanding customer responses to AI-driven personalized journeys: Impacts on the customer experience. Journal of Advertising, 54(2): 176-195. https://doi.org/10.1080/00913367.2025.2460985
[7] Wingert, S., Moskowitz, H.R., Rappaport, S.D., Deitel, Y. (2023). Developer goals for e-commerce startups: Applying AI-enhanced mind genomics to thinking about everyday issues. Psychology Journal: Research Open, 5(5): 1-12. https://doi.org/10.31038/psyj.2023553
[8] Änäkkälä, T. (2021). Exploring value in eCommerce artificial intelligence and recommendation systems. https://urn.fi/URN:NBN:fi:jyu-202105172951.
[9] Srivastava, A. (2021). The application & impact of artificial intelligence (AI) on E-commerce. Contemporary Issues in Commerce and Management, 1(1): 165-75.
[10] Nimbalkar, A.A., Berad, A.T. (2021). The increasing importance of AI applications in e-commerce. Vidyabharati International Interdisciplinary Research Journal, 13(1): 388-391.
[11] Santoso, A., Bawono, I.R., Manalu, V.G., Sulaiman, E., Purnomo, R.A. (2025). From stimulus to response: How shopping experience and information safety drive online purchase decisions? PaperASIA, 41(6b): 244-255. https://doi.org/10.59953/paperasia.v41i6b.860
[12] Goti, A., Querejeta-Lomas, L., Almeida, A., de la Puerta, J.G., López-De-Ipiña, D. (2023). Artificial intelligence in business-to-customer fashion retail: A literature review. Mathematics, 11(13): 2943. https://doi.org/10.3390/math11132943
[13] Zhang, X., Guo, F., Chen, T., Pan, L., Beliakov, G., Wu, J. (2023). A brief survey of machine learning and deep learning techniques for e-commerce research. Journal of Theoretical and Applied Electronic Commerce Research, 18(4): 2188-2216. https://doi.org/10.3390/jtaer18040110
[14] Chintalapati, S., Pandey, S.K. (2022). Artificial intelligence in marketing: A systematic literature review. International Journal of Market Research, 64(1): 38-68. https://doi.org/10.1177/1470785321101842
[15] Cahyani, A.D. (2023). Aspect-based sentiment analysis from user-generated content in shopee marketplace platform. Jurnal Ilmiah Teknik Elektro Komputer dan Informatika, 9(2): 444-454. https://doi.org/10.26555/jiteki.v9i2.26367
[16] Chiu, W., Cho, H., Chi, C.G. (2020). Consumers' continuance intention to use fitness and health apps: An integration of the expectation–confirmation model and investment model. Information Technology & People, 34(3): 978-998. https://doi.org/10.1108/itp-09-2019-0463
[17] Youssef, H.A.H., Hossam, A.T.A. (2023). Privacy issues in AI and cloud computing in e-commerce setting: A review. International Journal of Responsible Artificial Intelligence, 13(7): 37-46.
[18] Nakata, D., Smith, J. (2024). Transforming E-commerce: How AI revolutionizes customer experience. EasyChair Preprint, 13372.
[19] Korovkinas, K., Danėnas, P., Garšva, G. (2019). SVM and k-means hybrid method for textual data sentiment analysis. Baltic Journal of Modern Computing, 7(1): 47-60. https://doi.org/10.22364/bjmc.2018.7.1.04
[20] Flavián, C., Guinalíu, M., Gurrea, R. (2006). The role played by perceived usability, satisfaction and consumer trust on website loyalty. Information & Management, 43(1): 1-14. https://doi.org/10.1016/j.im.2005.01.002
[21] Babadoğan, B. (2024). Unveiling the power of AI-driven personalization: Transforming consumer behavior in the age of digital marketing. Next Frontier For Life Sciences and AI, 8(1): 61. https://doi.org/10.62802/fj43xy18
[22] Wilson, G., Johnson, O., Brown, W. (2024). The impact of artificial intelligence on digital marketing strategies. Preprints. https://doi.org/10.20944/preprints202408.0276.v1
[23] Khan, A.R., Akter, M.S., Islam, R. (2024). Big data analytics and predictive analysis in enhancing customer relationship management (CRM): A systematic review of techniques and tools. Non Human Journal, 1(1): 83-99. https://doi.org/10.70008/jmldeds.v1i01.44
[24] Johnson, O., Brown, W., Wilson, G. (2024). The role of big data analytics in retail marketing and supply chain optimization. Preprints. https://doi.org/10.20944/preprints202407.2058.v1
[25] Hosseinalibeiki, H., Zaree, M. (2023). A blockchain based solution to improve loyalty program with NFT in agribusiness. Journal of Smart Environments and Green Computing, 3(4): 127-146. https://doi.org/10.20517/jsegc.2023.09
[26] Arowogbadamu, A.A., Oziri, S.T., Seyi-Lande, O.B. (2024). Telemarketing and sponsorship analytics as strategic tools for enhancing customer acquisition and retention. Global Multidisciplinary Perspectives Journal, 1(5): 56-66. https://doi.org/10.54660/gmpj.2024.1.5.56-66
[27] Ling, C., Zhang, T., Chen, Y. (2019). Customer purchase intent prediction under online multi-channel promotion: A feature-combined deep learning framework. IEEE Access, 7: 112963-112976. https://doi.org/10.1109/access.2019.2935121
[28] Kai, Y., Valencia, M.G. (2024). The role of social network marketing on consumer engagement and purchase intention: A review. International Journal of Global Economics and Management, 4(1): 149-156. https://doi.org/10.62051/ijgem.v4n1.21
[29] Bumbaca, F., Misra, S., Rossi, P.E. (2020). Scalable target marketing: Distributed markov chain monte carlo for bayesian hierarchical models. Journal of Marketing Research, 57(6): 999-1018. https://doi.org/10.1177/0022243720952410
[30] Chugh, P., Jain, V. (2024). Artificial intelligence (AI) empowerment in E-commerce: A bibliometric voyage. NMIMS Management Review, 32(3): 159-173. https://doi.org/10.1177/09711023241303621
[31] Madanchian, M. (2024). The impact of artificial intelligence marketing on E-commerce sales. Systems, 12(10): 429. https://doi.org/10.3390/systems12100429
[32] Noranee, S., Bin Othman, A.K. (2023). Understanding consumer sentiments: Exploring the role of artificial intelligence in marketing. JMM17: Jurnal Ilmu Ekonomi Dan Manajemen, 10(1): 15-23. https://doi.org/10.30996/jmm17.v10i1.8690
[33] Thakur, J., Kushwaha, B.P. (2023). Artificial intelligence in marketing research and future research directions: Science mapping and research clustering using bibliometric analysis. Global Business and Organizational Excellence, 43(3): 139-155. https://doi.org/10.1002/joe.22233
[34] Raji, M.A., Olodo, H.B., Oke, T.T., Addy, W.A., Ofodile, O.C., Oyewole, A.T. (2024). E-commerce and consumer behavior: A review of AI-powered personalization and market trends. GSC Advanced Research and Reviews, 18(3): 66-77. https://doi.org/10.30574/gscarr.2024.18.3.0090
[35] Zhuk, A., Yatskyi, O. (2024). The use of artificial intelligence and machine learning in e-commerce marketing. Technology Audit and Production Reserves, 3(4(77)): 33-38. https://doi.org/10.15587/2706-5448.2024.305280
[36] Bangash, S.H., Khan, I., Husnain, G., Irfan, M.A., Iqbal, A. (2024). Revolutionizing healthcare with smarter AI: In-depth exploration of advancements, challenges, and future directions. VFAST Transactions on Software Engineering, 12(1): 152-168. https://doi.org/10.21015/vtse.v12i1.1760
[37] Papadakis, H., Papagrigoriou, A., Kosmas, E., Panagiotakis, C., Markaki, S., Fragopoulou, P. (2023). Content-based recommender systems taxonomy. Foundations of Computing and Decision Sciences, 48(2): 211-241. https://doi.org/10.2478/fcds-2023-0009
[38] Feremans, L., Cule, B., Vens, C., Goethals, B. (2020). Combining instance and feature neighbours for extreme multi-label classification. International Journal of Data Science and Analytics, 10(3): 215-231. https://doi.org/10.1007/s41060-020-00209-1
[39] Sahu, S., Kumar, R., Pathan, M.S., Shafi, J., Kumar, Y., Ijaz, M.F. (2022). Movie popularity and target audience prediction using the content-based recommender system. IEEE Access, 10: 42044-42060. https://doi.org/10.1109/access.2022.3168161
[40] Yi, S., Liu, X. (2020). Machine learning based customer sentiment analysis for recommending shoppers, shops based on customers’ review. Complex & Intelligent Systems, 6(3): 621-634. https://doi.org/10.1007/s40747-020-00155-2
[41] Alsini, A., Huynh, D.Q., Datta, A. (2021). Hashtag recommendation methods for twitter and Sina Weibo: A review. Future Internet, 13(5): 129. https://doi.org/10.3390/fi13050129
[42] Boratto, L., Carta, S., Iguider, W., Mulas, F., Pilloni, P. (2022). Fair performance-based user recommendation in eCoaching systems. User Modeling and User-Adapted Interaction, 32(5): 839-881. https://doi.org/10.1007/s11257-022-09339-6
[43] Samarasekara, P., Basnayake, N., Hureekaduwa, D., Weralupitiya, B. (2023). A modelling framework of an intelligent news recommendation engine for financial analysts. International Journal on Advances in ICT for Emerging Regions (ICTer), 16(4): 1-10. https://doi.org/10.4038/icter.v16i4.7269
[44] Ahmed, M., Ansari, M.D., Singh, N., Gunjan, V.K., V., S.K.B., Khan, M. (2022). Rating-based recommender system based on textual reviews using IoT smart devices. Mobile Information Systems, 2022: 1-18. https://doi.org/10.1155/2022/2854741
[45] Chou, J., Pham, T.T.P., Ho, C. (2021). Metaheuristic optimized multi-level classification learning system for engineering management. Applied Sciences, 11(12): 5533. https://doi.org/10.3390/app11125533
[46] Daskalakis, E., Remoundou, K., Peppes, N., Alexakis, T., Demestichas, K., Adamopoulou, E., Sykas, E. (2022). Applications of fusion techniques in E-commerce environments: A literature review. Sensors, 22(11): 3998. https://doi.org/10.3390/s22113998
[47] Su, X., Khoshgoftaar, T.M. (2009). A survey of collaborative filtering techniques. Advances in Artificial Intelligence, 2009: 1-19. https://doi.org/10.1155/2009/421425
[48] Al Jawarneh, I.M., Bellavista, P., Corradi, A., Foschini, L., Montanari, R., Berrocal, J., Murillo, J.M. (2020). A pre-filtering approach for incorporating contextual information into deep learning based recommender systems. IEEE Access, 8: 40485-40498. https://doi.org/10.1109/access.2020.2975167
[49] Zhang, D., Pee, L., Cui, L. (2021). Artificial intelligence in E-commerce fulfillment: A case study of resource orchestration at Alibaba’s Smart Warehouse. International Journal of Information Management, 57: 102304. https://doi.org/10.1016/j.ijinfomgt.2020.102304
[50] Ayyapparajan, R.A., Sabeena, S. (2022). Impact of artificial intelligence in e-commerce. Journal of University of Shanghai for Science and Technology, 24(8): 315-321.
[51] Nazim Sha, S., Rajeswari, M. (2019). Creating a brand value and consumer satisfaction in E-commerce business using artificial intelligence with the help of vosag technology. International Journal of Innovative Technology and Exploring Engineering, 8(8): 1510-1515.
[52] Enache, M. (2019). Machine learning in E-commerce. Annals of Dunarea De Jos University of Galati. Fascicle I. Economics and Applied Informatics, 25(1): 169-173. https://doi.org/10.35219/eai1584040920
[53] Bolikulov, F., Nasimov, R., Rashidov, A., Akhmedov, F., Cho, Y.I. (2024). Effective methods of categorical data encoding for artificial intelligence algorithms. Mathematics, 12(16): 2553 https://doi.org/10.3390/math12162553
[54] Mnyakin, M. (2020). Investigating the impacts of AR, AI, and website optimization on ecommerce sales growth. ResearchBerg Review of Science and Technology, 3(1): 116-130.
[55] Maylawati, D.S., Priatna, T., Sugilar, H., Ramdhani, M.A. (2020). Data science for digital culture improvement in higher education using K-means clustering and text analytics. International Journal of Electrical and Computer Engineering (IJECE), 10(5): 4569-4580. https://doi.org/10.11591/ijece.v10i5.pp4569-4580
[56] Abed, J., Hasnain, K.N., Sultana, K.S., Begum, M., Shatyi, S.S., Billah, M., Sadnan, G.A. (2024). Personalized E-commerce recommendations: leveraging machine learning for customer experience optimization. Journal of Economics, Finance and Accounting Studies, 6(4): 90-112. https://doi.org/10.32996/jefas.2024.6.4.10
[57] Ramos, R., Rita, P., Vong, C. (2023). Mapping research in marketing: Trends, influential papers and agenda for future research. Spanish Journal of Marketing - ESIC, 28(2): 187-206. https://doi.org/10.1108/sjme-10-2022-0221
[58] Barua, B., Kaiser, M.S. (2024). Leveraging machine learning for real-time personalization and recommendation in airline industry. Preprints. https://doi.org/10.20944/preprints202410.2436.v1
[59] Chabane, N., Bouaoune, A., Tighilt, R., Abdar, M., Boc, A., Lord, E., Tahiri, N., Mazoure, B., Acharya, U.R., Makarenkov, V. (2022). Intelligent personalized shopping recommendation using clustering and supervised machine learning algorithms. PLOS One, 17(12): e0278364. https://doi.org/10.1371/journal.pone.0278364
[60] Bawack, R.E., Wamba, S.F., Carillo, K.D.A., Akter, S. (2022). Artificial intelligence in E-Commerce: A bibliometric study and literature review. Electronic Markets, 32(1): 297-338. https://doi.org/10.1007/s12525-022-00537-z
[61] Miranda, C.H., Sánchez-Torres, G. (2024). Implementation and evaluation of a hybrid recommendation system for the real estate market. Data and Metadata, 3: 426. https://doi.org/10.56294/dm2024.426
[62] Zheng, T., Ding, M. (2023). Behavior-aware English reading article recommendation system using online distilled deep Q-learning. Journal of Cases on Information Technology, 25(1): 1-21. https://doi.org/10.4018/jcit.324102