CogD-ML: Cognitive determinants of social commerce purchase intention in Bangladesh using machine learning and explainable AI
Figures
Abstract
Cognitive factors are associated with online purchase intentions in developing economies, and the linear models conventionally used to study them can miss non-linear patterns. We report an applied integration of the Theory of Planned Behavior (TPB) with machine learning and explainable AI (XAI) to predict social media-driven e-commerce purchase intentions in Bangladesh. Survey data from 352 young, student-dominated consumers captured attitudes, subjective norms, perceived behavioral control, and purchase behavior on validated Likert scale items. After reliability-based labeling and feature selection, we ran an ablation across seven classical classifiers and one multilayer perceptron, with stratified five-fold cross-validation, threshold sensitivity analysis, and a cross-domain check. With all TPB constructs included, support vector machines and AdaBoost reached 92% accuracy on the held-out test set, and cross-validated mean accuracy ranged from 0.84 to 0.88 for every model except the decision tree. These figures should be read against a positive-class prevalence of 82.1%, which inflates accuracy and F1 relative to imbalance-robust measures. Transfer to an independent North Indian sample was weak, with SVM MCC falling from 0.522 to 0.315 and AUROC from 0.923 to 0.775. In SHAP analyses, the four items the model relied on most were PBC1 (motivation from frequent advertising), SN3 (approval when many others buy through social media), ATTD4 (past purchase), and SN1 (family influence). Bivariate correlations and pathway-level regression with Benjamini–Hochberg correction are interpreted as associations, not causal effects, and Brier score and log loss are reported alongside SHAP and LIME to show whether predicted probabilities are calibrated. These findings are exploratory and specific to the sampled population; given the convenience sample, the class imbalance, and the weak transfer, they are not evidence of robust generalization or of readiness for deployment.
Citation: Barua S, Rahman R, Azad AKA, Momen S (2026) CogD-ML: Cognitive determinants of social commerce purchase intention in Bangladesh using machine learning and explainable AI. PLoS One 21(11): e0362973. https://doi.org/10.1371/journal.pone.0362973
Editor: Rongbin Yang, Kaplan Business School of Australia, AUSTRALIA
Received: December 23, 2025; Accepted: November 2, 2026; Published: November 20, 2026
Copyright: © 2026 Barua et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: The repository at https://github.com/GitsSaikat/cogd-ml now contains the survey data, one script per reported table, the prompts, model settings, hyperparameter grids, seeds and pinned software versions; the external dataset is available from Mendeley Data (doi:10.17632/b9hdy2swyy.1).
Funding: This work was supported by North South University through the CTRG grant CTRG-23-SEPS-08 awarded to AKAA (https://www.northsouth.edu). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Competing interests: The authors have declared that no competing interests exist.
Introduction
Consumer behavior in online shopping is shaped by cognitive and social factors, and attitudes toward buying online remain a documented barrier to adoption [1,2]. Using predictive models to forecast consumer purchase intentions based on such cognitive factors can inform management strategies and decision-making [1–3]. Analysis of online consumer purchase intention is especially important in developing nations, where social and economic advancement often depends on technological integration. These nations face distinct obstacles, since their populace may be less familiar with digital markets compared to those in industrialized countries, which calls for an analysis of the factors associated with behavioral intentions. The absence of consumer analysis, prevalent in the technology industry, underscores the need to engage users and meet their needs to foster a positive intention. The commercialization of digital markets relies on marketing strategies and developments that vary by region [4]. These conditions highlight the need for a comprehensive investigation to ensure that advancements correspond with users’ cognitive behavior, thereby promoting intention.
The Theory of Planned Behavior (TPB) is a widely used cognitive framework that explains how individual behaviors, such as purchasing decisions, are shaped [5]. According to this theory, a person’s intention to engage in a behavior is the most immediate antecedent of their actions, and three key factors shape this intention: attitude, subjective norm, and perceived behavioral control. Building on TPB, prior work has linked trustworthiness to individuals’ attitudes toward online purchasing [1]. Other research has shown that a positive attitude is an important factor for Malaysian netizens when it comes to online purchasing [3]. South American studies have demonstrated that self-efficacy in online stores is a key factor in e-commerce purchases [2].
However, traditional SEM is constrained in its ability to find non-linear correlations, a restriction that machine learning (ML) approaches can relax. Consumer decision-making is often complex and non-linear, which highlights the capacity of multilayer perceptrons (MLPs) and related models to identify both linear and non-linear relationships [6,7]. A hybrid methodology in social commerce emphasizes the importance of incorporating non-linearity into the analysis of customer behavior [3]. Machine learning can also handle extensive datasets and reveal complex patterns that conventional structural equation modeling may miss. Prior work illustrates this by using machine learning ensembles to forecast cloud storage usage intentions in the Philippines, highlighting the efficacy of machine learning in analyzing extensive datasets [6]. Moreover, machine learning demonstrates its usefulness in exploratory studies where there is a lack of theoretical direction. Algorithms such as AdaBoost and multilayer perceptrons can capture complex, non-linear associations [3,6].
The aim of this research is to explore the interplay between established holistic cognitive constructs and machine learning and deep learning. The goal is to create an integrated framework for analyzing and predicting consumer purchasing intention in the e-commerce industry of Bangladesh, with a strong focus on explainability. With the increasing relevance of social media marketing in the eyes of customers, it is essential for firms to fully comprehend and adjust to consumer behavior. Shmueli argues that explanatory and predictive models answer different questions, and that prediction can expose relationships an explanatory model misses [8]; our framework reports both. These contextual insights may assist social media marketers in developing more targeted marketing plans, allocating resources more efficiently, and improving the consumer experience. A prediction of this kind is not a neutral artifact. A model that identifies which consumers are most responsive to social proof is, in application, a tool for applying social pressure more efficiently, and the explanations that make it auditable also make it actionable in ways that can narrow rather than widen the consumer’s choice [9]. We return to this in the Discussion.
In addition to overall accuracy, the framework incorporates sensitivity analysis of the purchase-behavior threshold, per-fold performance summaries, and separate calibration plots for Brier score and log loss to assess not only whether classifications are correct, but also whether predicted probabilities are well calibrated and stable across folds [10]. Accuracy alone can obscure overconfident or poorly calibrated models, whereas Brier score and log loss act as strictly proper scoring rules that penalize misaligned probabilities and overconfident errors, providing a more reliable basis for decision-making in high-stakes marketing and policy contexts [10]. The explainable AI component combines global SHAP analyses with local LIME-based explanations to enhance transparency at both aggregate and individual levels [11]. A single additional dataset is used to probe whether the fitted signals survive a change of population and instrument. This is a limited transferability check on one external sample, not an assessment of generalization.
- Dataset compilation: Our work compiles a survey dataset from Bangladesh, based on established cognitive constructs, checks its measurement model with confirmatory factor analysis (CFA), and tests the proposed pathways with bivariate regression analysis.
- Pathway-level hypothesis testing: Correlation analysis, ordinary least squares regression, and null hypothesis significance testing with Benjamini–Hochberg correction are used to evaluate each of the ten proposed pathways, with both raw and adjusted p-values reported.
- Predicting purchase intention: Classification models are implemented to predict the odds of consumers participating in online purchases using survey data.
- Explainable AI insights: Explainable Artificial Intelligence (XAI) methods are used to identify the survey items the fitted model relies on most and to rank them.
- Scope and applied reading: We report what the fitted models do and do not support for a young, student-dominated Bangladeshi convenience sample, including where the signal fails to transfer to another population. A prototype interface for inspecting model outputs is described in S2 Appendix; it is a demonstration, not a deployed system.
The remaining sections of the paper are arranged in the following sequence. Related work and research gaps are presented after this introduction. Following that, the research methodology is discussed. The results section provides an in-depth analysis of the findings and explores them further. In the discussion section, the study’s significant results and constraints are emphasized, followed by a discussion of potential avenues for further research.
Literature review
The literature on consumer purchase intention has evolved significantly, moving from linear statistical models to advanced machine learning and deep learning frameworks. To provide context for our study, this section is organized into six areas. We begin by reviewing foundational work on consumer purchase intention and the Theory of Planned Behavior. We then discuss the transition to machine learning for behavior prediction. Following this, we cover three further dimensions of our framework: the role of statistical analysis in validating cognitive constructs, explainable AI (XAI) for transparent decision-making, and cross-domain generalizability as a check on whether a model transfers. We also state where our study sits relative to recent consumer prediction work. By bridging these diverse fields, our work aims to address some limitations of isolated methodological approaches by combining multiple analytical perspectives on consumer behavior. Table 1 provides a comparative summary of key studies in this domain, highlighting their methodologies, sample characteristics, key findings, and the specific research gaps that our study aims to address.
Related work on consumer purchase intention
General disposition (or character) is considered an unreliable indicator of one’s behavior in specific situations [18]. The aggregation of particular behaviors across several instances, circumstances, and types of activity appears to indicate improved accuracy in predicting outcomes [19]. Nevertheless, the concept of behavior aggregation fails to clarify the variations in behavior observed across different settings or accurately foresee individual actions. Instead, it demonstrates that overall attitudes and personality traits have a broad impact on action, as shown in large, aggregated samples. These characteristics have an indirect influence on certain acts through immediate causes.
Ajzen et al. explore the elements that influence behavior using the Theory of Planned Behavior (TPB) framework [5]. TPB was formulated with the purpose of forecasting and understanding human behavior under certain circumstances [20]. The TPB was an extension of the Theory of Reasoned Action, where the intention to perform the behavior was primarily determined by the intention to perform the behavior, which in turn was influenced by attitudes and subjective norms [21]. TPB expands on the Theory of Reasoned Action by including perceived behavioral control as an additional determinant of intentions and behavior. The theory suggests that an intent to engage in a certain activity is the fundamental factor that predicts whether the behavior will really occur. It is possible to predict a person’s intentions with accuracy by taking into account their attitudes (positive or negative feelings toward the behavior), subjective norm (perceived social pressure to engage in or abstain from the behavior), and perceived behavioral control (perceived ease or difficulty of performing the behavior) [5].
A deeper exploration of TPB reveals that attitudes can shape intentions through mental imagery [22]. When users engage with objects in virtual product experiences, it stimulates the creation of clear mental images. These images can directly influence the intention to make a purchase, even if the users’ cognitive sentiments towards the brand are not a factor. Other findings suggest that the perceived usefulness of bloggers’ suggestions and their degree of trust have a substantial impact on the attitude of blog users towards online shopping and their intention to make purchases [23]. Furthermore, results indicate that distinct factors influence the users of blogs with a perceived high reputation and those with a perceived poor reputation [23].
Similar to attitude, subjective norm has significant effects on people’s intentions, especially when it comes to reproduction [24], exercise and healthy eating [25], and prosocial conduct [26].
Perceived behavioral control acts as a moderator in the association between intentions and actual behavior in health-related situations [27]. Bloggers have a significant impact on customers’ purchase decisions by establishing the perceived utility and usefulness of their recommendations [23].
Almost all of these studies rely on Structural Equation Modeling (SEM) to test linear relations among the factors and hypotheses. However, this approach has significant shortcomings, as accuracy decreases when the core assumptions of linear regression are not met [28]. These assumptions include factors like linearity, normal distribution of errors, and independence of variables. If the data is complex, non-linear, or irregular, the model may struggle to produce accurate predictions or insights. Another major drawback is that these methods are heavily reliant on theories, where a weakness in a researcher’s model can impact the prediction as well. This issue has been discussed through the lens of factor composition, noting that a researcher’s factor composition may be significant through SEM analysis, yet they may be the wrong factors to answer the research questions [29].
Related work on behavior prediction using machine learning
Machine learning (ML) methods have demonstrated promising results in predicting customer purchasing patterns in both physical and e-commerce environments [14]. Following the noteworthy success of psychological frameworks, extensive research has been done on consumer behavior prediction such as churning [30,31], car buying intention [32], and green consumption practices [33]. ML can be combined with SEM to improve both the predictive accuracy and explanatory power of research models. One approach used was a hybrid SEM-AI approach [6,34,35]. In this approach, SEM is first used to test the hypotheses and establish a foundational understanding of the linear relationships within the conceptual model. The significant predictors identified through SEM are then used as input nodes for an MLP analysis, allowing the model to capture non-linear and non-compensatory associations that SEM might miss. Researchers have predicted technology acceptance by applying machine learning to the Technology Acceptance Model (TAM) [7]. Other work has focused on machine learning prediction and explainability, rather than SEM results [6,35]. It has been shown that using a combination of attitude, subjective norm, and perceived behavior control as factors, Gradient Boosting can predict purchase intention with 91% accuracy [3]. Recently, a similar concept was explored using the Unified Theory of Acceptance and Use of Technology, identifying relevant factors using SEM and machine learning [35].
Statistical analysis in consumer behavior research
While machine learning models predict well, they often lack the theoretical validation needed to check that the underlying cognitive constructs are being measured correctly. To address this, our framework places measurement validation before predictive modeling. Traditional statistical tools, such as Cronbach’s alpha for reliability and factor analysis for validity, provide evidence on whether the survey instruments used to capture cognitive constructs are internally consistent [36]. Reporting descriptive statistics and bivariate associations before fitting complex models also makes it possible to see which relationships a learner is exploiting [8]. Structural Equation Modeling (SEM) is frequently employed to estimate structured relationships in behavioral models, though with cross-sectional data these estimates remain associational [28]. Combining these validation steps with our ML pipeline lets us check that the classification target is a psychometrically coherent construct rather than a measurement artifact.
Explainable AI (XAI) for consumer insights
A critical barrier to the adoption of advanced machine learning in marketing is the “black box” nature of complex algorithms, which obscure the decision-making process. This lack of transparency makes it difficult for stakeholders to trust model outputs or derive actionable marketing strategies. Explainable AI (XAI) has emerged as a vital solution to this challenge. In consumer behavior research, “black box” models like deep neural networks often fail to provide actionable insights, limiting their adoption by marketers who need to understand why a prediction was made [12]. XAI techniques, such as SHAP (SHapley Additive exPlanations) and LIME (Local Interpretable Model-agnostic Explanations), address this by quantifying the contribution of each feature to the final output [11,37]. Recent work in PLOS ONE has paired interpretability methods with consumer prediction, using SHAP over text-derived features to explain perceived risk across 262,752 online reviews [12]. Salih et al. caution that SHAP and LIME outputs are model-dependent, sensitive to collinearity among features, and cannot be read as causal [37]; we interpret our own explanations under that constraint.
Positioning relative to recent consumer prediction work
Consumer behavior prediction has advanced quickly in this journal, and it is worth stating plainly where our study sits relative to that work and where it does not compete. Lin applied SVM, XGBoost, CatBoost, and a backpropagation network to the Online Shoppers Purchasing Intention dataset, reporting F1 scores of 0.93 and 0.92 for CatBoost and XGBoost and an AUC of 0.985 [14]. Liu and Hu combined deep reinforcement learning with a Transformer to model shifting consumer interests from profiles and transaction records [15]. Sun coupled graph convolutional networks with a deterministic policy gradient to optimise personalised recommendation over user-product-query graphs [16]. Wang and Liu mined behavioural trajectories from continuous access logs to predict purchase events [17]. Qi et al. used a KeyBERT-TextCNN pipeline with SHAP over 262,752 reviews to predict and explain perceived risk [12].
We do not claim to advance on any of these in predictive terms, and the comparison would not be meaningful if we did. These studies use behavioural logs, transaction histories, interaction graphs, and review text: data generated as a by-product of platform use, available in volumes two to three orders of magnitude larger than ours, and containing no measurement of what the consumer believed or intended. Our data are the inverse. We measure attitude, subjective norm, and perceived behavioral control directly through a validated instrument, on 352 respondents, with no behavioural log at all. A CatBoost model on 12,330 clickstream sessions and a support vector machine on 352 psychometric responses are not answering the same question, and reporting a higher accuracy on one would say nothing about the other.
What our design permits, and log-based studies structurally cannot, is asking which reported cognitive construct carries the predictive signal, and then checking whether that construct is measured well enough for the question to mean anything. This is the reason the confirmatory factor analysis and discriminant validity checks appear before the classifiers rather than after them. It is also the reason our contribution is a modest one: we are not proposing a new architecture, and we are not extending the Theory of Planned Behavior. We are asking whether TPB constructs, measured in a Bangladeshi social commerce setting, behave as the theory predicts when a non-linear learner rather than a linear structural model is fitted to them, and reporting what happens when those signals are asked to transfer to another population. Both answers turn out to be qualified, and we report the qualifications.
Cross-domain generalizability
A critical but often overlooked dimension of model evaluation is cross-domain generalizability, assessing whether predictive signals learned in one context transfer to a structurally different population, domain, or measurement setting. Standard in-sample cross-validation cannot detect this form of fragility, as it assumes that training and test data are drawn from the same distribution [13]. Research in behavioral prediction has demonstrated that models evaluated only on held-out samples from the original survey may overestimate real-world utility when the deployment context differs in geography, culture, or instrument design [2]. Cross-domain evaluation using an independent external dataset, without any distribution matching or augmentation preserves the natural domain shift and yields a more honest estimate of transferability [33]. When surface metrics such as accuracy and F1 are inflated by class imbalance in the external dataset, class-imbalance-robust metrics such as the Matthews Correlation Coefficient (MCC) and AUROC provide a more reliable diagnostic signal [38]. Our study incorporates this evaluation to examine the degree to which TPB-based predictive signals generalize beyond the primary Bangladesh sample.
Methodology
The methodological framework adopted in this study is designed to predict and explain consumer purchase intention within the e-commerce context. As outlined in Fig 1, the process begins with a survey dataset rooted in the Theory of Planned Behavior (TPB). Pre-processing consists of ordinal encoding, feature selection, and binarization of the outcome. No resampling is applied, so the test set keeps the natural class balance. The analysis then has two strands. The first checks the measurement model with confirmatory factor analysis (CFA) and tests the hypothesized pathways with bivariate and multivariate regression. The second splits the data into training and test sets to train and tune eight classifiers. The framework ends with evaluation on standard performance metrics and with Explainable AI (XAI) interpretations of the fitted models.
The six phases of the study: questionnaire design, data collection, statistical analysis (exploratory analysis, CFA, correlations, and Benjamini–Hochberg adjusted pathway regressions), pre-processing, modelling and evaluation of eight classifiers, and explanation with SHAP and LIME. The exploratory language-model comparison and the prototype interface are reported in S1 and S2 Appendix.
Questionnaire design
The questionnaires were carefully designed, drawing on established research in the field [39]. The questionnaire consisted of two sections, “Section A” and “Section B”. “Section A” focused on gathering information on the demographic profile and psychographics of the respondents. “Section B” included questions on TPB constructs. To design the questionnaire for “Section B”, we followed the survey protocols from previous studies, where each construct consisted of four questions [3,39]. Table 2 presents a comprehensive summary of each construct, including the specific questions and their related explanations. We employed a 5-point scale that spanned from “Strongly Disagree” to “Strongly Agree.” Additionally, we refined the phrasing of the questions used in earlier studies to enhance clarity.
Measurement of perceived behavioral control
Ajzen defines perceived behavioral control as the perceived ease or difficulty of performing a behavior [5]. Later work treats it as having two components: self-efficacy, or confidence in one’s ability to perform the behavior, and controllability, or the sense that performing it is up to oneself [40]. Items written to that definition usually ask directly about ability or control. Our four PBC items come from the instrument of Zhou et al. [39], which was also used in the Malaysian study we compare against [3]. We kept their meaning unchanged so that results remain comparable across the three samples.
Read against Ajzen’s definition, these items measure something narrower: how far respondents treat social media as a workable channel for their purchase decisions. PBC2 asks whether the respondent will use social media as a reference channel for future purchases. PBC3 and PBC4 ask whether they would recommend it to friends and family for that purpose, and PBC1 asks whether frequent advertising moves them to buy. Choosing a channel as one’s reference and recommending it to others presuppose that one finds the channel usable, so the items carry the controllability side of PBC in this setting. They do not measure self-efficacy. PBC2–PBC4 are also worded as future intentions, which brings them closer in content to the outcome than standard PBC items are.
We checked whether that closeness shows up in the data. The four items load on a single factor in the confirmatory factor analysis, with standardized loadings of at least 0.60, a composite reliability of 0.808, and an AVE of 0.515 (see ‘Measurement model assessment’). The square root of the PBC AVE (0.717) exceeds the correlation of PBC with PB (0.530), and the PBC–PB heterotrait–monotrait ratio is 0.655, below the conservative 0.85 cutoff [41]. The items therefore behave as a construct distinct from purchase behavior. We nonetheless read every PBC result in this paper as a result about channel reliance and willingness to recommend, not about perceived ability in Ajzen’s full sense, and we return to this in the Limitations.
Data collection
Exploratory data analysis
To elucidate the underlying structure of consumer responses, we conducted a detailed exploratory analysis of the Likert-scale data across the four primary constructs: Attitude (ATTD), Subjective Norm (SN), Perceived Behavioral Control (PBC), and Purchase Behavior (PB). As illustrated in Fig 2, the distribution of responses reveals distinct patterns of consensus and variability that characterize the study population.
Distribution of participant responses on a 5-point Likert scale for Purchase Behavior (PB), Perceived Behavioral Control (PBC), Subjective Norm (SN), and Attitude (ATTD). Colors represent response categories from “Strongly Disagree” (red) to “Strongly Agree” (green), showing the cumulative percentage of agreement for each item.
Perceived Behavioral Control (PBC) was characterized by a high degree of ambivalence. The dominant “Neutral” category across items PBC1 (motivation from frequent ads) through PBC4 (recommending to family) suggests that many respondents neither embrace nor reject social media as a channel for their purchase decisions. Finally, Purchase Behavior (PB) aligned closely with Attitude, albeit with slightly more moderate enthusiasm. While the intention to purchase as indicated by PB4 (experience buying due to influence) showed strong agreement, impulse buying tendencies captured by PB3 (easily influenced to make impulsive purchases) elicited higher disagreement, highlighting a rational, rather than purely impulsive, decision-making process among respondents.
Data pre-processing
Feature selection.
The Theory of Planned Behavior (TPB) posits that an individual’s conduct may be reliably predicted by considering their Attitude (ATTD), Subjective Norm (SN), and Perceived Behavioral Control (PBC). Therefore, our training data exclusively comprised these TPB features, while all other data columns were excluded. Regarding the dependent variable, Purchase Behavior (PB), we calculated the Cronbach’s alpha score for its constituent items (PB1, PB2, PB3, and PB4), which showed good internal consistency (). Consequently, we consolidated these items into a single column by calculating their mean. This aggregation simplified the analytical task into a binary classification problem, an approach consistent with previous methodologies [3].
Data labeling.
Each of the TPB constructs was quantified using a Likert scale ranging from “Strongly Disagree” to “Strongly Agree.” We applied ordinal encoding to convert these qualitative responses into a numerical format for all constructs. The predictive capability of the model hinges on determining whether an individual’s intention translates into an actual purchase decision. To facilitate this, we transformed the dependent variable PB—which represents the average of the four related questionnaire items—into binary values. Aligned with prior research that utilized thresholds to categorize purchase probability, we classified PB values as “Likely to Buy” and all other values as “Unlikely to Buy” [3]. As a result, the target variable was encoded as a binary value, where 0 represents “Unlikely to Buy” and 1 represents “Likely to Buy.” The detailed procedure for this transformation is outlined in Algorithm 1. The binarization threshold of was selected as the a priori midpoint of the 5-point Likert scale, consistent with prior work using the same instrument [3,39]. We retain this threshold on a priori grounds rather than empirical ones. A formal ROC analysis yielded an AUROC of 0.927, indicating that the ranking produced by the model is informative, but the threshold sensitivity analysis reported below shows that accuracy and F1 are higher at a cutoff of 2.25 and the SVM’s agreement metrics higher at 2.75. We therefore do not claim that 2.5 is optimal, only that it is the scale midpoint and is used consistently for comparability with prior work.
Algorithm 1 Data pre-processing algorithm.
1: procedure Pre-processData
2: Input: Survey responses dataset
3: Output: Preprocessed dataset
4: for each respondent in dataset do
5: Encode responses using ordinal encoding:
6: ATTD encodeLikertScale(response[‘Attitude’])
7: SN encodeLikertScale(response[‘SocialNorm’])
8: PBC encodeLikertScale(response[‘PerceivedBehaviorControl’])
9: PB encodeBinary(response[‘PurchaseBehavior’], threshold = 2.5)
10: end for
11: Split dataset into training and test sets:
12: [trainData, testData] splitDataset(dataset, 0.8)
13: end procedure
Measurement model assessment
Prior to the machine learning classification pipeline, a formal measurement model assessment was conducted to evaluate the psychometric validity of the four latent constructs: Purchase Behavior (PB), Attitude (ATTD), Subjective Norm (SN), and Perceived Behavioral Control (PBC). This step is essential to ensure that the high predictive accuracy observed in the classification models reflects genuine construct-level behavioral signal rather than a shared measurement artifact arising from the common Likert-scale structure of all survey items.
A four-factor Confirmatory Factor Analysis (CFA) was estimated using maximum likelihood estimation. All 16 items loaded significantly onto their intended factors (p < 0.001), with no cross-loadings, which is consistent with PB, ATTD, SN, and PBC being four distinct latent constructs. The model fit well: , CFI = 0.960, TLI = 0.950, RMSEA = 0.049, and GFI = 0.917. These values meet the cutoffs of CFI and TLI and RMSEA suggested by Hu and Bentler [43].
Table 5 presents the construct reliability and validity indices. Cronbach’s ranged from 0.773 (SN) to 0.816 (PB), and Composite Reliability (CR) from 0.776 to 0.820, exceeding the 0.70 threshold [44]. Average Variance Extracted (AVE) ranged from 0.466 to 0.534. SN and ATTD fall marginally below the strict 0.50 threshold, but the remaining validity evidence is adequate and is consistent with TPB survey instruments reported in prior work [3]. Inter-construct correlations, presented in Table 6, ranged from 0.354 to 0.552, indicating moderate but theoretically expected associations.
Discriminant validity was assessed using the Fornell–Larcker criterion [45] and the Heterotrait–Monotrait (HTMT) ratio [41]. The Fornell–Larcker criterion was satisfied for all constructs: the square root of each construct’s AVE exceeded its highest inter-construct correlation (Table 5). All six HTMT ratios were well below the conservative 0.85 threshold (range: 0.448–0.695; Table 7), which indicates that PB is empirically distinct from the predictor constructs. These results support the construct validity of the measurement model, with the caveat on the content of the PBC items given above.
Ablation studies
An ablation study is a systematic method used to evaluate the contribution of distinct components within a model. By methodically removing or altering specific elements, researchers can determine how these factors influence overall performance, thereby identifying crucial components while isolating redundant ones. In the context of consumer behavior prediction, this is particularly vital because the Theory of Planned Behavior (TPB) posits several antecedents of intention. Isolating these constructs allows us to verify whether all theoretical components (Attitude, Norms, Control) are empirically necessary for accurate prediction in the specific context of Bangladeshi e-commerce, or if a simpler subset of factors suffices.
For instance, prior work employed this approach by training models separately on oversampled and undersampled datasets to assess the impact of resampling techniques [46]. That study found that while models without resampling achieved high accuracy, their suboptimal F1 scores indicated an imbalance between precision and recall, whereas oversampling improved F1 scores at the expense of some accuracy [46]. In this work, we conducted an ablation study by systematically varying the combination of input constructs. We evaluated Perceived Behavioral Control (PBC), Subjective Norm (SN), and Attitude (ATTD) both individually and in various combinations to determine their specific contributions to the predictive power of the model.
Applied algorithms
This study employed seven machine learning models—Support Vector Machine (SVM), Logistic Regression (LR), K-Nearest Neighbors (kNN), Decision Tree (DT), AdaBoost, Random Forest (RF), and Gradient Boosting (GB)—alongside one deep learning model based on a Multilayer Perceptron (MLP). This selection expands upon models used in prior research by incorporating a deep learning architecture to further explore predictive capabilities [3]. The procedure for training and evaluating these models across different feature sets is outlined in Algorithm 2.
First introduced by Cortes and Vapnik, SVM is a supervised learning algorithm that identifies an optimal, maximum-margin hyperplane between classes and handles non-linear decision boundaries through kernel functions [47]. Logistic Regression (LR) is a widely used method that models the probability of an input belonging to a particular class using the logistic function, producing output probabilities in the range [0, 1].
The K-Nearest Neighbor (kNN) technique is a classifier that identifies the k closest training instances to a query in feature space and assigns a label based on majority voting. Decision Trees (DT), conceptualized by Quinlan, iteratively partition data according to feature values, forming a tree structure where internal nodes encode decision rules and leaves correspond to class labels [48]. Random Forests (RF) extend this concept by aggregating multiple trees trained on bootstrapped samples and randomly selected feature subsets, reducing variance and improving generalization compared to a single tree.
AdaBoost is a meta-estimator that trains a sequence of base learners on reweighted data, increasing the weights of misclassified examples at each iteration to focus on difficult cases [49]. Gradient Boosting (GB) is another ensemble technique that sequentially fits weak learners to the residuals of a loss function, allowing the model to correct errors from previous stages [50]. Finally, the Multilayer Perceptron (MLP) serves as a deep learning baseline; it is a feed-forward neural network with fully connected hidden layers that optimizes parameters via backpropagation to capture complex nonlinear relationships in the data.
Algorithm 2 Training, evaluation, and ablation study procedure.
1: procedure TrainEvaluateAblation (models, featureSets, trainData, testData)
2: Input: List of models, list of feature sets, training data, test data
3: Output: Accuracy and F1 scores for each model-feature combination
4: for each featureSet in featureSets do
5: Print: “Evaluating Feature Set:”, featureSet
6: for each model in models do
7: Print: “Training Model:”, model.name
8: model.train(trainData[featureSet], trainData[’PB’])
9: predictions model.predict(testData[featureSet])
10: accuracy calculateAccuracy(predictions, testData[’PB’])
11: f1Score calculateF1Score(predictions, testData[’PB’])
12: Print: “Model:”, model.name, “Accuracy:”, accuracy, “F1 Score:”, f1Score
13: end for
14: Print: “————————–”
15: end for
16: end procedure
Model evaluation and variance control
Given the limited dataset size (n = 352), preventing optimistic performance estimates was a priority. We evaluated each classifier—SVM, AdaBoost, Gradient Boosting, Logistic Regression, Decision Tree, Random Forest, kNN, and MLP—using stratified 5-fold cross-validation. These runs use the default settings of each classifier, including an RBF-kernel SVM, on all twelve items rather than the tuned settings of Table 8. For every metric (accuracy, F1, precision, recall, ROC-AUC), we computed the fold mean (), standard deviation (s), and a 95% confidence interval to quantify uncertainty and stability across folds. We visualized fold dispersion using boxplots and summarized central tendencies with bar charts and error bars, ranking dispersion via a stability score to complement mean performance. Pairwise comparisons were conducted on fold accuracies using paired t-tests (comparing SVM against each alternative) as descriptive evidence, with the caveat that folds are not fully independent. For future analyses involving extensive hyperparameter tuning, we recommend nested cross-validation to avoid evaluation bias.
Threshold sensitivity analysis
Defining the boundary between “likely” and “unlikely” to purchase is often ambiguous in survey-based research, where Likert scale responses do not inherently map to binary outcomes. Arbitrary thresholds can bias model performance and lead to misleading conclusions about consumer intent. To see how much the choice of threshold matters, we conducted a threshold sensitivity analysis. The continuous PB_mean score, representing the average purchase behavior, was converted into a binary target at cutoffs from 2.25 to 4.00 in increments of 0.25. Below 2.25 fewer than 6% of respondents fall into the negative class, which would leave four or fewer negative cases in the test set. At each cutoff we re-used the stratified 80/20 split of the main analysis (seed 42) and trained two classifiers with default settings: a Support Vector Classifier (SVC) with a radial basis function kernel and an AdaBoost classifier. We report accuracy, F1-score, Cohen’s Kappa, and the Matthews Correlation Coefficient (MCC) on the 71 test cases. Separately, we located the probability cut-point that maximizes Youden’s J on the ROC curve of the SVM under equal error costs [51]. This cut-point is chosen on the same test cases on which it is evaluated, so the metrics reported at it are optimistic.
Hyperparameter tuning
Hyper-parameter tuning involves exploring a predefined set of hyper-parameter values using methods such as grid search cross-validation (GridSearchCV). The objective of this process is to maximize the performance of a machine learning model by identifying the optimal configuration that enhances its predictive accuracy and generalization capabilities. In accordance with the ablation study, we created seven distinct combinations of Attitude (ATTD), Perceived Behavioral Control (PBC), and Subjective Norm (SN). Since each combination resulted in a different feature space, we performed separate optimization procedures to find the optimal hyperparameters for each setting. Each grid search used shuffled five-fold cross-validation on the training set (seed 42), scored by accuracy. Table 8 details all possible combinations of our constructs and the corresponding optimal hyperparameters identified for each learning model.
Cross-domain generalizability analysis
To evaluate the extent to which TPB-based predictive signals transfer beyond the primary sample, the trained models were applied to an independent external dataset on green purchase behavior collected from North Indian consumers in November 2022 (n = 253) [52]. The external dataset was used in its raw form without any distribution matching or augmentation, in order to preserve the natural domain shift and obtain an honest estimate of cross-domain performance. Feature values were normalised from the 7-point to the 5-point Likert scale (); two items absent from the external instrument (SN4, PBC4) were imputed with training-set column means; and the outcome variable was binarised at the scale midpoint (, equivalent to on the 5-point scale). Both classifiers use default settings on the twelve standardized items: an RBF-kernel SVM and AdaBoost with 50 estimators. Standardization leaves the SVM’s test-set classifications unchanged but moves its in-domain AUROC from 0.927 (ROC analysis) to 0.923 (cross-domain results). The two datasets differ simultaneously in geography, product domain, measurement instrument, and Likert scale, so this is a single transferability check under a compound shift and cannot isolate which difference drives any change in performance.
Statistical analysis
The statistical framework proceeds in three analytically distinct stages that serve complementary purposes within the theoretical model. First, bivariate correlation analysis is used to characterize the associational structure among all study variables, providing a descriptive foundation for subsequent modelling. Second, pathway-level OLS regression is used to test each of the ten theoretically proposed hypotheses independently, with Benjamini-Hochberg (BH) correction applied across all ten simultaneous tests to control the false discovery rate and guard against Type I error inflation. Third, structural path analysis assembles the pathway regressions into one diagram, to show the full pattern of supported and unsupported pathways within the theoretical model. Importantly, the ML classification pipeline reported separately constitutes a predictive analysis, while the pathway and structural analyses reported here constitute explanatory analyses; these serve distinct inferential purposes and are not directly compared in terms of performance.
To examine the proposed theoretical framework, we employed a multi-method analytical approach combining correlation analysis, bivariate regression, and a path diagram assembled from the pathway regressions. The analysis was conducted on data collected from 352 participants, with statistical significance established at . Pearson correlation coefficients were computed to assess the strength and direction of bivariate relationships among all study variables, including the TPB constructs (perceived behavioral control, attitude towards behavior, and subjective norm), experience factors (social media activity and purchase frequency), and the outcome variable (purchase behavior). This preliminary analysis provided insight into the interconnectedness of the theoretical constructs and informed subsequent hypothesis testing.
For hypothesis testing, bivariate simple regression using ordinary least squares (OLS) estimation was performed to evaluate each of the ten proposed pathways independently. Each hypothesis was tested through a separate regression model where the dependent variable was regressed on a single independent variable, allowing for a direct assessment of individual pathway associations. Unstandardized regression coefficients (), standard errors, t-statistics, and p-values were computed for each model, with R2 values reported to indicate the proportion of variance explained by each predictor. Hypotheses were evaluated using a null hypothesis significance testing framework (). To address the inflated Type I error risk arising from ten simultaneous pathway tests, p-values were adjusted using the Benjamini-Hochberg (BH) false discovery rate procedure. Both raw and BH-adjusted p-values are reported in the Results. A pathway was considered empirically supported only if it remained significant after BH correction (padj < 0.05). H7 and H10 concern the same pair of variables. A bivariate regression cannot separate the two directions, so both are tested by the same model and share one estimate; we keep both to preserve the original numbering.
To visualize the complete network of relationships, we assembled the results of the individual regression models into a single path diagram. This diagram summarizes separate bivariate models; it is not a jointly estimated structural equation model. Path coefficients are marked by BH-adjusted significance (padj < 0.01 and padj < 0.05), with dashed lines for unsupported pathways. It should be noted that the structural path analysis is conducted under the theoretical structure proposed by the TPB and reflects association-based path estimates derived from cross-sectional survey data. Causal interpretation of these estimates requires assumptions of no unmeasured confounding and correct model specification, which cannot be verified from cross-sectional data alone. Accordingly, path estimates are interpreted as theoretically guided associational relationships rather than causal effects.
Additionally, correlation heatmaps were generated to illustrate the pattern of associations across all variables, complementing the regression-based hypothesis tests with descriptive relational information. All statistical analyses were performed using Python with the statsmodels and scipy libraries for regression analysis and correlation computation, while visualizations were created using the matplotlib and seaborn packages to ensure reproducibility and transparency in the analytical workflow. Fig 3 illustrates the hypothesized model structure.
Graphical representation of the theoretical framework and the ten proposed pathways tested in this study, illustrating relationships between TPB constructs, experience factors, and purchase behavior.
Exploratory language-model analysis (supporting information)
We also tested whether an instruction-tuned language model could recover purchase intention from serialised TPB responses, following work on language models for tabular prediction [53,54] and retrieval-augmented generation [55]. Every configuration fell below the classical classifiers, so the analysis plays no part in the paper’s argument; methods and results are in S1 Appendix.
Reproducibility
The survey data and code are public at https://github.com/GitsSaikat/cogd-ml. The repository has one script per analysis, and each script writes the tables and draws the figures it produces. Construct membership is defined once in the code. A test fails if any purchase behavior column overlaps with a perceived behavioral control item, which was the source of the target leakage corrected in the previous revision. The same test recomputes the 92% headline accuracy and checks 34 values printed in this paper, plus the 128 Table 9 values described below, against the script outputs. The data split, cross-validation folds, and every stochastic model use seed 42, and package versions are pinned.
The construct-subset ablation (Tables 8 and 9, and the figures drawn from them) runs under scikit-learn 1.5.2, pinned separately, because later versions removed the AdaBoost algorithm used in the original run. Under that version the script reproduces every SVM, logistic regression, kNN, and AdaBoost cell of Table 9 and the whole SN row exactly. The original run did not fix seeds for the decision tree, random forest, gradient boosting, and MLP. In the other six rows, 12 of those 24 cells reproduce exactly and the rest differ by one to eight percentage points. That is within the spread of these models across seeds: over eleven seeds on the full construct set, test accuracy ranged from 72% to 80% for the decision tree, 82% to 85% for gradient boosting, 86% to 90% for the random forest, and 79% to 93% for the MLP. The external North Indian sample is not redistributed; the repository explains how to download it from Mendeley Data [52]. The language-model analysis in S1 Appendix needs a GPU and is run separately. The comparison on the Malaysian data uses the public dataset of Zhou et al. [39] and is not part of the repository.
Results
This section presents the empirical findings of our multi-method framework. Reliability testing gave Cronbach’s alpha values of , indicating acceptable internal consistency across all Theory of Planned Behavior (TPB) dimensions. We checked the measurement model with confirmatory factor analysis and tested the hypothesized relationships with bivariate regression, which showed positive associations of attitude, subjective norm, and perceived behavioral control with purchase behavior. Among the eight classifiers, Support Vector Machine (SVM) and AdaBoost reached the highest held-out accuracy, 92%, with a weighted F1-score of 91%. The ablation study showed that individual constructs carry predictive value and that the full TPB set performs best. Finally, SHAP and LIME explanations of the SVM showed that it relies most on the items PBC1, SN3, ATTD4, and SN1.
Performance analysis of TPB factors
This section evaluates the performance of the classifiers trained on our dataset. We examined several metrics, including the confusion matrix, ROC curve, precision-recall curve, and learning curve. To quantitatively assess performance for each combination of TPB constructs, we used Accuracy (Eq 1), Precision (Eq 2), Recall (Eq 3), and F1-score (Eq 4).
(1)(2)(3)(4)Different classifiers perform differently across the TPB constructs. Table 9 presents the detailed performance metrics for each classifier across all feature combinations. The F1-score considers both precision (how many predicted positive instances are actually positive) and recall (how many actual positives are correctly identified), making it a balanced measure of a model’s ability to predict purchase behavior.
SVM and AdaBoost yielded the best results on the combination of Attitude (ATTD), Subjective Norm (SN), and Perceived Behavioral Control (PBC), achieving the highest accuracy at 92%. Logistic Regression followed closely with an accuracy of 90%. SVM also led in F1-score, reaching 91%, a performance matched by AdaBoost. For the combination of ATTD and SN, Logistic Regression achieved the highest performance with an accuracy and F1-score of 90%, identifying it as the most reliable model for this feature set. In the ATTD and PBC combination, Logistic Regression reached the highest accuracy, 86%, with an F1-score of 84%, and SVM followed at 85%. When considering SN and PBC, Logistic Regression and MLP both reached 87%, with F1-scores of 86% and 87%. For ATTD alone, AdaBoost and Gradient Boosting showed the highest accuracy at 85%, and Gradient Boosting the highest F1-score at 81%. With only SN as a feature, Logistic Regression and MLP both reached 87% accuracy and an F1-score of 85%, while Random Forest was weakest at 72%. Finally, for PBC alone, SVM and AdaBoost achieved the top accuracy, 82%, and kNN the highest F1-score, 77%. Predictive power is generally lower when only PBC is considered.
Fig 4 shows test-set accuracy for every model and feature combination. SVM and AdaBoost reach the outermost point on the full TPB construct set (ATTD, SN, and PBC).
Each axis represents a different combination of TPB constructs (ATTD, SN, PBC), and the radial axis starts at 0.65. SVM and AdaBoost (thick lines) reach the highest accuracy, 0.92, on the full construct set. Values are those of Table 9.
Confusion matrix analysis.
To gain deeper insight into the classification behavior of our models, we analyzed the confusion matrices for selected models across different feature subsets (Fig 5). The confusion matrix provides a granular breakdown of correct and incorrect predictions, distinguishing between True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN).
(a) SVM with the full TPB constructs (ATTD, SN, PBC) shows the highest correct classification rate. Panels (b)–(g) show selected models on pairwise and single-construct feature sets, with more false positives or false negatives; panel (f) is the logistic regression trained on the four SN items. Rows are actual and columns predicted classes on the 71 test cases.
The full construct set separates the classes better than any subset. The Support Vector Machine (SVM) trained on Attitude, Subjective Norm, and Perceived Behavioral Control made the fewest errors (Fig 5a). It correctly identified 57 “Likely to Buy” cases (TP) and 8 “Unlikely to Buy” cases (TN), with a minimal misclassification rate (1 FN, 5 FP). This indicates a high sensitivity to detecting potential buyers while maintaining a low false alarm rate. In contrast, as we isolate individual constructs, the model’s ability to separate classes diminishes. For instance, the Logistic Regression model using only the Perceived Behavioral Control (PBC) factor (Fig 5g) exhibited a notable increase in False Positives (12 FP), suggesting that relying solely on perceived control leads to an overestimation of purchase intent. Dropping constructs mainly costs performance on the minority class: with PBC alone, only one of the 13 negative cases is recognized.
Receiver Operating Characteristic (ROC) curve analysis.
We further evaluated the classifiers’ diagnostic ability using Receiver Operating Characteristic (ROC) curves, which plot the True Positive Rate (Recall) against the False Positive Rate across various decision thresholds. The Area Under the Curve (AUC) serves as a scalar measure of performance, where an AUC of 1.0 represents a perfect classifier and 0.5 represents random guessing.
The ROC curves in Fig 6 show that the combined feature sets discriminate best. The model utilizing all three constructs (ATTD, SN, PBC) achieved the highest AUC scores (Fig 6a), with Logistic Regression and SVM both reaching 0.90. The curves for these models arch sharply toward the top-left corner, indicating high sensitivity and specificity. Pairwise combinations (Figs 6b–d) stay close to the full set, while single-factor models (Figs 6e–g) flatten the curves, ATTD most of all. With PBC alone, AUCs fall to between 0.74 and 0.80 (Fig 6g). Individual TPB factors carry predictive value, and combining them improves separation between buyers and non-buyers.
ROC curves for each feature combination; legend values are the areas under the curves. The full TPB model (a) reaches an AUC of 0.90 for Logistic Regression and SVM, while single-construct models (e)–(g) discriminate less well. Curves for DT, RF, GB, and MLP come from the seeded rerun of the ablation (see Reproducibility).
Precision-Recall curve analysis.
Given the potential for class imbalance in purchase behavior data, we examined Precision-Recall (PR) curves to assess model performance specifically on the positive class (“Likely to Buy”). Unlike ROC curves, PR curves are more informative when the cost of false positives is high, visualizing the trade-off between Precision (positive predictive value) and Recall (sensitivity).
The PR curves in Fig 7 separate the models less than the ROC curves do. Because 82% of test cases are positive, a classifier that labels everyone as likely to buy already has a precision of 0.82, so the area under the PR curve (AUPRC) is high for every feature set, between 0.85 and 0.98. On the full construct set (Fig 7a), the areas range from 0.91 for the decision tree to 0.96 for kNN, with SVM and AdaBoost at 0.92. The lowest areas belong to the SVM trained on Attitude alone (0.85, Fig 7e) or SN alone (0.86, Fig 7f), where precision drops earliest as recall increases.
Precision–recall curves for each feature combination; legend values are the areas under the curves. Because 82% of test cases are positive, precision stays high for every set (areas 0.85–0.98). Curves for DT, RF, GB, and MLP come from the seeded rerun of the ablation (see Reproducibility).
Model calibration.
While classification accuracy is important, the reliability of the predicted probabilities is crucial for decision-making, especially in marketing contexts where resource allocation depends on confidence levels. We evaluated this using two calibration metrics: Brier Score (measuring the mean squared difference between predicted probability and actual outcome) and Log Loss (penalizing confident but wrong predictions).
These estimates use the default settings of each model on all twelve items, scored on the 71 test cases. As shown in Fig 8, predictive accuracy and calibration quality diverge. AdaBoost, one of the two most accurate models, has a Brier Score of 0.150, so its predicted probabilities are poorly calibrated. Logistic Regression has the lowest Brier Score (0.069) and Log Loss (0.299). The MLP (Brier 0.085) and SVM (Brier 0.093) come next, and the SVM’s Log Loss (0.310) is second only to Logistic Regression. The Decision Tree outputs only probabilities of 0 or 1 and is worst on both measures (Brier 0.282, Log Loss 10.15). Random Forest has a moderate Brier Score (0.112) but a high Log Loss (0.824), which reflects a few confident errors. For applications that use the predicted probabilities, such as targeted discount campaigns, Logistic Regression or SVM would be preferred, despite AdaBoost’s slightly higher accuracy.
Brier Score (left) and Log Loss (right) on the held-out test set; lower is better. The Decision Tree’s Log Loss (10.15) is truncated. Logistic Regression and SVM give the best-calibrated probabilities, and AdaBoost and the Decision Tree the worst.
Comparison with previous study
A prior study found Gradient Boosting to be the strongest model in this domain, using Attitude (ATTD), Subjective Norm (SN), and Perceived Behavioral Control (PBC) to reach an accuracy of 91% and a comparable F1-score [3]. We applied our SVM to the same Malaysian dataset [39], following their 80/20 train-test protocol.
Our SVM reached an accuracy of 95% and an F1-score of 97% on that test set, against 91% for the Gradient Boosting baseline. Fig 9 contrasts the two, and Fig 10 gives the confusion matrices. Our SVM produced no false negatives and two false positives (Fig 10a). The comparison is indicative rather than like-for-like. Our test set contained 32 positive and 12 negative cases, while the matrix reported by the prior study contains 20 and 24 (Fig 10b), so the split or the labelling differed between the two evaluations. With 44 test cases, the gap of four percentage points corresponds to about two cases.
Accuracy and F1-score of our SVM and of the Gradient Boosting model reported by the previous study [3] on the Malaysian survey data. The two evaluations used test sets of different class composition (Fig 10).
(a) Our SVM on its held-out test set (32 positive and 12 negative cases), with no false negatives. (b) The Gradient Boosting model as reported by the previous study [3], whose test set had 20 positive and 24 negative cases.
Cross-validated performance with uncertainty
To assess model stability, we analyzed the performance metrics across stratified 5-fold cross-validation. SVM achieved the highest mean accuracy (, 95% CI [0.855, 0.900]) and the highest mean F1-score (), with Logistic Regression close behind () and more stable across folds. Among the baseline models, Logistic Regression delivered the strongest ROC-AUC (). Decision Tree performed markedly worse ( accuracy, 0.657 ROC-AUC). The confidence intervals of the leading models overlap substantially, so the ordering among them should not be over-interpreted. Fig 11 displays the mean scores with standard deviation (SD) error bars, fold-wise boxplots, and stability rankings to make variance explicit.
Top: Mean performance metrics with standard deviation error bars. Middle: Boxplots showing the distribution of Accuracy and F1 scores across 5 folds, highlighting model consistency. Bottom-left: Mean accuracy with 95% confidence intervals for the top four models. Bottom-right: Stability ranking (1/SD) indicating model robustness across data splits.
Paired t-tests on fold accuracies revealed no significant difference between SVM and any of AdaBoost, Gradient Boosting, Logistic Regression, Random Forest, KNN, or MLP. The only comparison reaching significance was SVM against Decision Tree (p = 0.0199). Given five folds and the non-independence of training sets, these tests are descriptive rather than confirmatory. The primary performance metrics (Accuracy and F1-score) are presented in Table 10, while detailed metrics for Precision, Recall, and ROC-AUC are provided in Table 11. The statistical comparison results are detailed in Table 12.
Cross-validation stability analysis.
To ensure the reliability of our findings beyond aggregate metrics, we conducted a granular analysis of model stability across the 5-fold cross-validation process (Fig 11). This evaluation indicates how consistently each algorithm performs when trained on different subsets of the data.
The “Cross-Validation Performance: Mean SD” analysis (Fig 11, top panel) shows SVM and Logistic Regression with the highest mean accuracy, followed closely by MLP, AdaBoost, Gradient Boosting, and KNN. The spread separating these six models is smaller than the fold-to-fold variation within any one of them, so we treat them as indistinguishable on this data. Decision Tree is the clear exception, performing worse on every metric and markedly so on ROC-AUC.
The distribution of performance across folds is the more informative view. The boxplots for Accuracy and F1 (Fig 11, middle panels) show that Logistic Regression and KNN have the narrowest fold-to-fold spread, while SVM and MLP vary more, and Decision Tree varies most. The “Model Stability Ranking” (Fig 11, bottom-right) quantifies this as the inverse of the standard deviation. Read together with the paired tests, in which only the SVM–Decision Tree comparison reached significance, these results support a narrow conclusion: with 352 respondents and five folds, this design can separate a weak model from the rest, but it cannot rank the leading classifiers against one another. We therefore report SVM as a representative rather than a superior model.
Threshold sensitivity analysis
The results of the sensitivity analysis are summarized in Fig 12 and Table 13. Performance varies with the cutoff in a way that tracks class balance rather than model quality. Accuracy and F1 are highest for both models at 2.25, where 88.6% of cases are positive, and decline as the classes approach balance. At the a priori midpoint of 2.5, where 82.1% of cases are positive, SVM reaches an accuracy of 0.873 and an F1 of 0.926, with a Cohen’s of 0.502 and a Matthews Correlation Coefficient (MCC) of 0.522. AdaBoost is slightly higher at this cutoff (0.887 accuracy, 0.932 F1, 0.602 MCC). We therefore do not treat 2.5 as an empirically optimal operating point. It is the scale midpoint, retained for comparability with prior work, and the surrounding rows show that much of the variation across cutoffs reflects how many cases fall into the majority class.
Values on the held-out test set at each cutoff. Top: accuracy (left) and F1 (right) are highest at 2.25 and fall as the threshold rises. Bottom left: the share of positive cases falls with the threshold and is 82.1% at the a priori midpoint of 2.5. Bottom right: SVM MCC and Cohen’s peak at 2.75, and AdaBoost MCC at 3.0. The vertical line marks 2.5.
The accuracy and F1 plots (Fig 12, top row) show both measures falling as the cutoff rises. Above 3.0 the positive class becomes the minority, and SVM F1 drops from 0.897 at 3.0 to 0.200 at 4.0. The agreement metrics behave differently (Fig 12, bottom right). SVM MCC peaks at 2.75 (0.745) and AdaBoost MCC at 3.0 (0.763), because these cutoffs leave more negative cases for the models to identify.
The classes are closest to balance at 3.25 (49.4% positive; Fig 12, bottom left), where both models do worse (SVM accuracy 0.718, AdaBoost 0.606). No single cutoff is best on every metric. Relative to 2.25, the midpoint of 2.5 gives up some accuracy and F1; relative to 2.75, it gives up some agreement. We accept both costs to keep the binarization comparable with prior work using the same instrument.
ROC analysis and threshold validation
To provide an empirical basis for the binary threshold selection and to assess whether predictive performance is dependent on the specific threshold chosen, a formal ROC curve analysis was conducted on the SVM classifier of Table 13 (RBF kernel, default settings) using probability estimates. The area under the ROC curve (AUROC) was 0.927, indicating that the model ranks positive above negative cases well, independently of any particular cutoff.
Youden’s J statistic [51] was computed across all decision thresholds to locate the operating point that maximizes it. The J-maximizing probability threshold was 0.796, yielding a Youden’s J score of 0.820 with a true positive rate (TPR) of 0.897 and a false positive rate (FPR) of 0.077. The elevated optimal probability threshold (relative to the conventional 0.5) is a direct and expected consequence of the 82.1% positive class imbalance: when the positive class dominates, predicted probabilities concentrate near 1.0, and the optimal operating point shifts accordingly [56]. This cut-point was selected on the same 71 test cases on which it is evaluated, so the metrics at the Youden point are optimistic; a cut-point chosen on training data or by nested cross-validation would likely do less well.
Table 14 compares model performance at the default probability threshold (0.5) and the Youden-optimal threshold (0.796). The Matthews Correlation Coefficient (MCC), recommended for imbalanced classification [57], rises from 0.522 to 0.729 between the two. Discrimination, as measured by AUROC, is threshold-free and unaffected, but the operating point clearly matters for minority-class performance, and we do not claim that classification results are invariant to it. Fig 13 presents the ROC curve with the Youden-optimal operating point and the corresponding Youden’s J statistic plotted against all decision thresholds.
(Left) ROC curve with AUROC = 0.927; the filled circle marks the Youden-optimal operating point at FPR = 0.077, TPR = 0.897, probability threshold = 0.796. (Right) Youden’s J statistic plotted across all decision thresholds, peaking at 0.796. Minor fluctuations in the right panel reflect the small test set size (n = 71) at the 80/20 split.
Explainable AI (XAI)
While machine learning models like SVM and Random Forest predict well, their complexity often renders them as “black boxes,” obscuring the rationale behind their decisions. This lack of transparency can be a barrier to adoption in marketing strategies, where understanding why the model reaches a prediction matters as much as the prediction itself. To make the fitted models inspectable, we employed Explainable AI (XAI) techniques. Specifically, we utilized SHAP (SHapley Additive exPlanations) and LIME (Local Interpretable Model-agnostic Explanations) to show how the model uses each feature, both globally and for individual respondents. We explain the tuned linear SVM of Table 9 (C = 10, 92% test accuracy). SHAP values were computed with a kernel explainer on the model’s predicted probability of “Likely to Buy”, with 50 training cases as background (seed 42).
SHAP assigns each feature a contribution that raises or lowers a prediction. The global SHAP summary plot (Fig 14) ranks features by mean absolute SHAP value. PBC1 (0.053) and SN3 (0.053) contribute most, followed by ATTD4 (0.040) and SN1 (0.039). SN4, the item on encouragement from friends, ranks eleventh of twelve. Summed by construct, SN items contribute most (0.103), then PBC (0.096) and ATTD (0.077). The beeswarm plot shows the direction of these contributions: low values (blue dots) of SN3, SN1, and PBC1 push the model toward an “Unlikely to Buy” prediction, and high values (red dots) push it toward “Likely to Buy”.
Features are ranked by mean absolute SHAP value; PBC1, SN3, ATTD4, and SN1 contribute most. Red dots (high item values) generally push predictions toward “Likely to Buy”, and blue dots (low values) toward “Unlikely to Buy”.
For individual respondents we used SHAP waterfall plots (Fig 15). For a respondent the model rates unlikely to buy (P = 0.19, Fig 15a), the largest negative contributions come from SN3 (), SN1 (), ATTD4 (), and PBC1 (). This respondent answered 1 on SN1 and SN3 and 2 on ATTD4 and PBC1. For a respondent rated likely to buy (P = 0.995, Fig 15b), the contributions are smaller and spread across items, led by PBC1 (+ 0.05), SN3 (+ 0.04), and PBC2 (+ 0.03).
(a) A respondent rated unlikely to buy (P = 0.19), pushed down mainly by low SN3, SN1, ATTD4, and PBC1. (b) A respondent rated likely to buy (P = 0.995), with smaller positive contributions led by PBC1, SN3, and PBC2.
LIME gives a consistent picture for the same two respondents (Fig 16). For the respondent rated unlikely to buy, the rules with the largest negative weights are SN3 (), PBC1 (), and ATTD4 (). For the respondent rated likely to buy, the largest positive weights belong to PBC1 > 4 (+ 0.10), 3 < SN3 (+ 0.10), and SN1 > 3 (+ 0.07). Fig 17 lists both respondents’ answers to all twelve items.
Weights of each rule toward the class “Likely to Buy” for (a) the respondent rated unlikely and (b) the respondent rated likely to buy. Green bars raise and red bars lower the predicted probability. Rules on SN3, PBC1, SN1, and ATTD4 carry the largest weights.
Answers on the 5-point scale to all twelve TPB items for (a) the respondent rated unlikely and (b) the respondent rated likely to buy (Figs 15 and 16).
SHAP and LIME point to the same items: SN3, SN1, and PBC1, with ATTD4 next. Both describe how this model uses its inputs; neither is evidence about what causes consumers to buy [37].
Cross-domain generalizability results
Table 15 presents the performance of SVM and AdaBoost when evaluated on the raw external dataset (n = 253, 92.1% positive class) without any distribution augmentation. Surface metrics such as accuracy and F1 nominally exceed in-domain values (SVM accuracy: 0.929 vs. 0.873; F1: 0.963 vs. 0.926). However, this is a well-documented artefact of extreme class imbalance: with 92.1% of the external dataset belonging to the positive class, a majority-class-biased predictor trivially achieves high weighted scores. The Matthews Correlation Coefficient (MCC) and AUROC, which are robust to class imbalance, provide the honest assessment. SVM MCC declines from 0.522 to 0.315 () and AUROC from 0.923 to 0.775; AdaBoost MCC declines from 0.602 to 0.449 and AUROC from 0.866 to 0.859. The models’ recall on the minority class (Unlikely to Buy) falls to 0.150 for SVM and 0.300 for AdaBoost, meaning that only three and six of the twenty negative cases in the external sample are recovered. Transfer is therefore weak rather than partial: on the external data the classifiers approach the behaviour of a majority-class predictor. Both estimates rest on twenty negative cases, so they are imprecise, and we present them as indicative only. As illustrated in Fig 18, the MCC column visually captures this honest performance gap, in contrast to the misleadingly high accuracy and F1 scores driven by class distribution. These results are presented solely as a preliminary indicator of the transferability of TPB-based predictive signals across domains, and should not be interpreted as evidence of robust generalisation given the compounded domain gap in geography, construct, measurement instrument, and Likert scale [33].
Grouped bar charts comparing in-domain (Bangladesh held-out test set, blue) and cross-domain (raw North India dataset, orange) performance for SVM (left) and AdaBoost (right) across four metrics. Accuracy and F1 are inflated cross-domain due to the 92.1% positive class distribution in the external dataset. MCC and AUROC provide the unbiased assessment, showing performance declines (SVM MCC: ; AUROC: ) that honestly reflect the domain gap between Bangladesh social commerce and North Indian green purchase behavior [33].
Statistical test results
The following results are organized in line with the three-stage analytical framework described in the Methods: (1) bivariate associations among TPB constructs and experience factors; (2) pathway-level hypothesis tests with BH-corrected p-values; and (3) structural visualization of supported and rejected pathways. All pathway estimates reflect theoretically guided associations under the cross-sectional TPB structure and are not interpreted as causal effects.
The hypothesized model presents a theoretical framework grounded in the Theory of Planned Behavior (TPB), proposing ten hypotheses (H1–H10) to disentangle the relationships between external experience factors (social media activity and purchase frequency) and the internal cognitive antecedents of Purchase Behavior (PB).
Statistical analyses conducted on a sample of N = 352 participants supported seven of the ten hypotheses (70% support rate), as illustrated in the structural path model (Fig 19). Crucially, these seven supported pathways remained significant after Benjamini-Hochberg correction for multiple comparisons across all ten simultaneously tested hypotheses (all padj < 0.05), and the three rejected hypotheses remained non-significant after correction (padj > 0.13), so multiple-testing adjustment does not change the pattern of findings.
Path diagram assembled from the ten bivariate regressions. Values are unstandardized slopes (); ** marks padj < 0.01 and * padj < 0.05 after Benjamini-Hochberg correction. Solid lines are supported paths and dashed lines unsupported ones. The TPB core (PBC, SN, ATTD) is associated with purchase behavior, while Social Media Activity is not significantly associated with these constructs.
The analysis revealed an ordering of association among the TPB constructs. Subjective Norm (SN) showed the strongest bivariate association with Purchase Behavior (, p < 0.001, H3), with Perceived Behavioral Control (PBC) close behind (, p < 0.001, H1) and Attitude (ATTD) weaker but still significant (, p < 0.001, H2). The gap between SN and PBC is small relative to their standard errors, so we do not claim that either is dominant; what the data support is that both social pressure and perceived control are associated with purchase behavior more strongly than attitude is. This ordering is consistent with the multivariate model reported below, in which SN and PBC also carry the larger coefficients. Subjective Norm and Perceived Behavioral Control were also positively associated (, p < 0.001, H8). With cross-sectional data we cannot tell whether social validation strengthens reliance on the channel or the reverse.
A notable finding from the path analysis is the disconnect between passive engagement and behavioral intent. The dashed lines in Fig 19 illustrate that Social Media Activity was not significantly associated with any of the three TPB constructs. Hypotheses linking social media activity to PBC (H5, ), ATTD (H6, ), and SN (H9, ) were all rejected (padj > 0.13). In this sample, how active respondents are on social media says little about their attitudes, norms, or perceived control.
Purchase frequency, by contrast, was associated with purchase behavior. It showed a positive association with Purchase Behavior (, p < 0.001, H4) and with Attitude (, padj = 0.013, H7 and H10, which share one model). Purchase frequency, unlike social media activity, was associated with attitude in this sample.
The Pearson correlation matrix heatmap (Fig 20) shows the same pattern. The darkest cells mark the associations between PB and the core TPB variables, SN (r = 0.552) and PBC (r = 0.530) above all. The cells for Social Media Activity are light, with correlations of 0.077 to 0.133 with PB and the TPB constructs. Table 16 details these bivariate relationships, while Table 17 provides the complete hypothesis testing summary including BH-adjusted p-values.
Darker blue cells mark stronger positive correlations, such as PB–SN (r = 0.552) and PB–PBC (r = 0.530). The light cells for Social Media Activity show its weak correlations with the other variables.
Statistical determinants of purchase intention.
To evaluate the relative contribution of the cognitive constructs, we performed a multivariate ordinary least squares (OLS) regression of purchase intention on Attitude, Subjective Norm, and Perceived Behavioral Control (PBC). This model estimates the three associations jointly, accounting for shared variance among the predictors. To protect against the inflation of Type I error rates associated with simultaneous testing, all reported significance levels were adjusted using the Benjamini-Hochberg (BH) procedure.
The multivariate model explains 41.6% of the variance in consumer purchase intention (R2 = 0.416; F(3, 348) = 82.53, p < 0.001). The regression results, summarized in Table 18, show that all three TPB constructs remain significant predictors of purchase intention when modeled jointly.
Subjective Norm (, p < 0.0001) and PBC (, p < 0.0001) have the largest coefficients. Social pressure and reliance on social media as a purchase channel are therefore the constructs most strongly associated with purchase intention in this sample. Attitude remains significant but has a smaller coefficient (, p = 0.0015). These results are consistent with the TPB structure, and the three constructs together account for 41.6% of the variance in purchase intention.
Prototype interface (supporting information)
To make the fitted model inspectable we built a small web interface that returns a prediction for user-supplied construct values. It is a demonstration rather than a validated tool: it has not been tested with marketers, evaluated on live data, or assessed for decision quality, and no claim in this paper depends on it. It is described in S2 Appendix, and its layout is shown in S1 Fig.
Discussion
In this study, we bridged the gap between behavioral theory and predictive analytics, offering a comprehensive evaluation of how advanced machine learning techniques can operationalize the Theory of Planned Behavior (TPB) for e-commerce applications. By combining measurement validation with classification models and model explanations, we provided a contextually grounded, applied perspective on consumer purchase intention within the Bangladeshi e-commerce context. The following subsections interpret our findings in the context of existing literature, acknowledge our study’s limitations, and outline future research directions to further refine predictive modeling in consumer behavior.
Interpretation and comparison
Within this Bangladeshi sample the TPB constructs behaved broadly as the theory anticipates. Subjective Norm (SN) and Perceived Behavioral Control (PBC) were more strongly associated with purchase intention than attitude was. Given how PBC was measured here, this means that social validation and reliance on social media as a purchase channel mattered more in this sample than a favorable view of social media advertising. SHAP and LIME showed which survey items the model relies on, which opens its predictions to inspection by marketers.
On the Malaysian data used by a prior study [3], our SVM reached 95% accuracy against the 91% reported there for Gradient Boosting, although the two evaluations used test sets of different class composition. On our own Bangladeshi test set the SVM reached 92%. On the external North Indian sample, however, transfer is weak: SVM MCC falls from 0.522 to 0.315 and AUROC from 0.923 to 0.775, with only three of twenty negative cases recovered, so we make no claim of comparable performance outside the sampled population.
Social influence, persuasion, and consumer autonomy
Our strongest and most stable result is that subjective norm carries more predictive weight than attitude. The SHAP analysis places two SN items, SN3 (approval when many others buy through social media) and SN1 (family influence), among the four items the model relies on most. Read only as a prediction problem, this is a targeting instruction: identify consumers whose reported susceptibility to social influence is high, and direct social proof at them. We think the finding is more interesting, and more uncomfortable, than that reading allows.
The Theory of Planned Behavior treats subjective norm as a perception the consumer holds about what important others expect. It does not assume that perception is accurate, nor that it arose independently of the marketing environment. In social commerce the distinction largely collapses. The social encouragement a consumer reports is often encouragement that a recommendation system arranged for them to see, and the visible social proof that shapes it is itself an output of ranking and targeting decisions. Under those conditions, a model that predicts responsiveness to social influence and a system that manufactures the social influence are not separate objects, and the construct our model finds most predictive is the one most open to being engineered.
This is where the autonomy-threat literature is directly relevant. Spais et al. argue that AI-driven marketing raises the prospect that consumers experience persuasion as a constraint on their own agency rather than as information, and that avoiding this threat is a design requirement rather than an afterthought [9]. Our results give that argument an empirical edge in this setting: the lever with the greatest predictive purchase is also the one whose use is hardest to distinguish from manipulation, because it works by altering what the consumer believes others expect of them rather than by changing what the product is. Perceived behavioral control is nearly as strong a predictor. As measured here it reflects reliance on social media as a purchase channel, and the interventions that bear on it, such as clearer delivery terms or a simpler checkout, make the channel easier to use. They tend to widen the consumer’s options rather than exploit a belief about peers. Where our findings support a practical recommendation, we think it is the latter rather than the former.
Trust is the term that connects these threads and that our instrument does not measure. Prior TPB work in online retail treats trust as a determinant of attitude [1], but our data contain no trust items, so we cannot say whether the norm–attitude asymmetry we observe reflects a substantive difference in how these constructs operate or the absence of a mediating variable that would explain both. Spais and Jain situate this question within a broader shift, arguing that AI-era consumer behavior research must account for changing modes of interaction, ethical constraints, and interdisciplinary demands that established models were not built to carry [58]. We do not resolve any of that here. We raise it because a study that reports social influence as the dominant predictor, and offers explanations designed to make that influence operational, has an obligation to state what the finding could be used for and where we think it should not be.
Nature of the contribution
It is worth being explicit about what kind of contribution this study makes, since a reviewer could reasonably read the combination of TPB, machine learning, and explainable AI as a claim to theoretical advance. It is not one. We do not modify the Theory of Planned Behavior, propose new constructs, or identify a mechanism the theory did not already anticipate. The contribution is applied and, secondarily, methodological: a validated TPB instrument administered in a setting that is under-represented in this literature, analysed with a pipeline in which measurement validation precedes prediction, with the resulting explanations and the failure to transfer both reported.
Within that scope, two findings are worth recording. Subjective norm and perceived behavioral control are more strongly associated with purchase behavior than attitude is, consistently across bivariate, multivariate, and SHAP-based analyses, which is a substantive result about this population rather than a restatement of the theory. And the same fitted signal transfers poorly to a different population and instrument, recovering three of twenty negative cases. The second finding matters as much as the first: it indicates that the association between these constructs and purchase behavior is estimated here in a way that is specific to the sample, and that TPB-based prediction should not be assumed portable across populations merely because the constructs are.
We also conducted an ablation study across construct subsets. Our SVM model reached approximately 92% accuracy on the held-out test set with all three constructs included, though cross-validated estimates place it within the range of several other classifiers rather than ahead of them. On the Malaysian data of a prior study [3] our SVM also scored above the published baseline, although the two test sets differed in class composition; cross-market generalization should not be assumed without validation on more diverse samples. SHAP showed that four survey items, PBC1, SN3, ATTD4, and SN1, contribute most to the model’s predictions, which tells a practitioner which responses the model is reacting to.
Limitations
Although convenience sampling has practical advantages, it also has inherent limits that affect the interpretation of the results. Our study’s focus on university students was a deliberate methodological choice, as this demographic represents a highly active and influential segment of early adopters, making their purchasing intentions particularly relevant to our exploratory research questions. However, this demographic homogeneity, which exhibits an 82% student and 18–25 age composition, limits the socioeconomic representation of our findings. Consequently, all findings are explicitly bounded by this young, student-dominated demographic. Future research should proactively address this by employing stratified random sampling across diverse occupational and geographic tiers to ensure demographic representativeness. Furthermore, we recommend that future work conduct a Multi-Group Analysis (MGA) to statistically test for significant differences in TPB construct pathways between this student cohort and older, professional consumer segments, thereby validating whether the mechanisms identified here hold for a broader population.
A further limitation concerns the breadth of the analyses relative to the evidence available to support them. A single sample of 352 respondents underpins a confirmatory factor analysis, eight classifiers, threshold and calibration analyses, SHAP and LIME explanations, and a cross-domain check, with a language-model comparison in S1 Appendix. These components are not independent confirmations of one another. They are successive views of the same data, and each inherits the same sampling and measurement limits. The constraint is sharpest for the minority class. At the 2.5 binarization threshold only 63 of 352 respondents fall into the Unlikely to Buy category, 13 of which appear in the held-out test set, and the external sample contains 20 negative cases. Every minority-class quantity we report, including recall, MCC, and the calibration estimates, therefore rests on small counts and carries wide uncertainty that the point estimates alone do not convey. We report these analyses because each addresses a question a reader would reasonably ask, but we intend them collectively as an internally consistent account of one sample rather than as accumulating evidence of robustness.
The content of two constructs limits how far the construct-level results can be read in TPB terms. The PBC items capture channel reliance and willingness to recommend rather than self-efficacy, and three of them are worded as future intentions (see Measurement of perceived behavioral control). ATTD4 (having purchased products advertised on social media) and PB4 (having bought a product because of social media) both ask about past purchasing, so part of the attitude–outcome association may reflect shared content rather than attitude as such. The discriminant validity checks show that the constructs are empirically separable, but they cannot remove overlap in wording. Future studies should use PBC items written to Ajzen’s self-efficacy and controllability components [40] and keep past-behavior items out of the attitude scale.
As all constructs were measured using the same Likert scale in a single session, Common Method Bias (CMB) [59] remains a residual design limitation despite randomized question ordering. Future research should address this through multi-source or behaviorally anchored measurement designs.
Future work
We propose that future research address these limitations by expanding the demographic scope to include a more diverse range of age groups, income levels, and geographic regions. As noted, our present findings are explicitly bounded by our student-dominated convenience sample; therefore, we propose a research agenda utilizing stratified random sampling and Multi-Group Analysis (MGA) to test the stability of these TPB pathways across age and occupational strata. Additionally, we recommend incorporating external variables such as economic indicators, platform user experience metrics, and actual purchase history (rather than just intention) to provide a more holistic view of consumer behavior. We also suggest longitudinal designs to track how these associations change as market conditions and technologies change. Two directions follow from the autonomy question raised above. The first is to measure trust and perceived manipulation alongside the TPB constructs, which would allow a test of whether subjective norm predicts purchase behavior directly or through a trust pathway our instrument cannot observe. The second is to ask whether the constructs remain stable as consumer interaction shifts toward immersive and agent-mediated channels, where the sources of social influence are less legible to the consumer than a peer recommendation is [58]. If TPB constructs are to remain useful for prediction in those settings, their measurement will need to keep pace with how the influence they describe is produced.
Conclusion
In this study, we applied an integration of cognitive behavioral theory and machine learning to predict online purchase intention within a specific regional and demographic context. After checking the measurement model with confirmatory factor analysis and running construct-subset ablations, we found that Subjective Norms and Perceived Behavioral Control were the constructs most strongly associated with consumer intent in the young, student-dominated Bangladeshi market. Our tuned SVM model achieved 92% accuracy on the held-out test set, but transferred weakly to an external sample, where MCC fell from 0.522 to 0.315. The accompanying web application is a demonstration of the fitted model rather than a validated tool, and has not been tested with marketers or on live data. Taken together, these results characterize purchase intention in one young, student-dominated Bangladeshi sample and indicate where social validation and reliance on social media as a purchase channel merit attention; establishing whether they hold more widely requires further study on more diverse samples.
Supporting information
S1 Appendix. Exploratory language-model analysis.
Full methods, system and serialisation prompts, quantisation and QLoRA settings, retrieval configuration, and results for the controlled ablation of Qwen2.5-1.5B-Instruct across Zero-Shot prompting, retrieval-augmented generation, and QLoRA fine-tuning. All three paradigms fall below the classical classifiers reported in the main text; QLoRA is the strongest (MCC = 0.52) and retrieval-augmented generation fails on the minority class (MCC = 0.01).
https://doi.org/10.1371/journal.pone.0362973.s001
(PDF)
S2 Appendix. Prototype interface.
Description of the Streamlit application used to inspect model outputs for user-supplied construct values. The application is a demonstration of the fitted model and has not been evaluated under deployment conditions.
https://doi.org/10.1371/journal.pone.0362973.s002
(PDF)
S1 Fig. Prototype interface layout.
Interface diagram of the Streamlit application described in S2 Appendix, showing the sidebar where construct scores are entered and the panels that display the profile and the predicted purchase intention.
https://doi.org/10.1371/journal.pone.0362973.s003
(PNG)
References
- 1. George JF. The theory of planned behavior and Internet purchasing. Internet Research. 2004;14(3):198–212.
- 2. Peña-García N, Gil-Saura I, Rodríguez-Orejuela A, Siqueira-Junior JR. Purchase intention and purchase behavior online: A cross-cultural approach. Heliyon. 2020;6(6):e04284. pmid:32613132
- 3. Azad MS, Khan SS, Hossain R, Rahman R, Momen S. Predictive modeling of consumer purchase behavior on social media: Integrating theory of planned behavior and machine learning for actionable insights. PLoS One. 2023;18(12):e0296336. pmid:38150431
- 4.
Chesbrough H, Vanhaverbeke W, West J. New frontiers in open innovation. Oxford: Oxford University Press. 2014.
- 5. Ajzen I. The theory of planned behavior. Organizational Behavior and Human Decision Processes. 1991;50(2):179–211.
- 6. Ong AKS, Altes GC, German JD. Actual usage assessment among cloud storage consumers in the Philippines using a machine learning ensemble approach. Sci Rep. 2024;14(1):28955. pmid:39578523
- 7. Chung D, Jeong P, Kwon D, Han H. Technology acceptance prediction of robo-advisors by machine learning. Intelligent Systems with Applications. 2023;18:200197.
- 8. Shmueli G. To explain or to predict?. Statistical Science. 2010;25(3):289–310.
- 9. Spais G, Phau I, Jain V. AI marketing and AI ‐based promotions impact on consumer behavior and the avoidance of consumer autonomy threat. J of Consumer Behaviour. 2023;23(3):1053–6.
- 10. Brier GW. Verification of forecasts expressed in terms of probability. Mon Wea Rev. 1950;78(1):1–3.
- 11.
Ribeiro MT, Singh S, Guestrin C. Why should I trust you?: Explaining the predictions of any classifier. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016. 1135–44. https://doi.org/10.1145/2939672.2939778
- 12. Qi L, Xie Y, Zhang Q, Zhang J, Ma Y. Multi-feature fusion-based consumer perceived risk prediction and its interpretability study. PLoS One. 2025;20(1):e0316277. pmid:39752422
- 13. Murch WS, Kairouz S, French M. Establishing the temporal stability of machine learning models that detect online gambling-related harms. Computers in Human Behavior Reports. 2024;14:100427.
- 14. Lin J. Application of machine learning in predicting consumer behavior and precision marketing. PLoS One. 2025;20(5):e0321854. pmid:40327711
- 15. Liu N, Hu D. The design of consumer behavior prediction and optimization model by integrating DQN and LSTM. PLoS One. 2025;20(7):e0327548. pmid:40601676
- 16. Sun B. Data-driven personalized marketing strategy optimization based on user behavior modeling and predictive analytics: Sustainable market segmentation and targeting. PLoS One. 2025;20(7):e0328151. pmid:40705708
- 17. Wang X, Liu D-F. Pattern mining and prediction techniques for user behavioral trajectories in e-commerce. PLoS One. 2025;20(5):e0320772. pmid:40378101
- 18. Wicker AW. Attitudes versus Actions: The Relationship of Verbal and Overt Behavioral Responses to Attitude Objects. Journal of Social Issues. 1969;25(4):41–78.
- 19. Epstein S. Aggregation and beyond: Some basic issues on the prediction of behavior. J Pers. 1983;51(3):360–92. pmid:28497598
- 20.
Ajzen I. Attitudes, personality and behavior. 2nd ed. Maidenhead, UK: Open University Press; 2005.
- 21. Fishbein M. A theory of reasoned action: some applications and implications. Nebr Symp Motiv. 1980;27:65–116. pmid:7242751
- 22. Schlosser AE. Experiencing Products in the Virtual World: The Role of Goal and Imagery in Influencing Attitudes versus Purchase Intentions. J CONSUM RES. 2003;30(2):184–98.
- 23. Hsu C, Chuan‐Chuan Lin J, Chiang H. The effects of blogger recommendations on customers’ online shopping intentions. Internet Research. 2013;23(1):69–88.
- 24. Yu X, Liang J. Social norms and fertility intentions: Evidence from China. Front Psychol. 2022;13:947134. pmid:36467244
- 25. Yun D, Silk KJ. Social norms, self-identity, and attention to social comparison information in the context of exercise and healthy diet behavior. Health Commun. 2011;26(3):275–85. pmid:21400325
- 26. Steg L, de Groot J. Explaining prosocial intentions: testing causal relationships in the norm activation model. Br J Soc Psychol. 2010;49(Pt 4):725–43. pmid:20021707
- 27. Hagger MS, Cheung MW-L, Ajzen I, Hamilton K. Perceived behavioral control moderating effects in the theory of planned behavior: A meta-analysis. Health Psychol. 2022;41(2):155–67. pmid:35143225
- 28. Tomarken AJ, Waller NG. Structural equation modeling: strengths, limitations, and misconceptions. Annu Rev Clin Psychol. 2005;1:31–65. pmid:17716081
- 29. Maula M, Stam W. Enhancing Rigor in Quantitative Entrepreneurship Research. Entrepreneurship Theory and Practice. 2019;44(6):1059–90.
- 30. Ullah I, Raza B, Malik AK, Imran M, Islam SU, Kim SW. A churn prediction model using random forest: analysis of machine learning techniques for churn prediction and factor identification in telecom sector. IEEE Access. 2019;7:60134–49.
- 31. Khodabandehlou S, Zivari Rahman M. Comparison of supervised machine learning techniques for customer churn prediction based on analysis of customer behavior. JSIT. 2017;19(1/2):65–93.
- 32. Li J, Pan S, Huang L, Zhu X. A machine learning based method for customer behavior prediction. Tehnički Vjesnik. 2019;26(6):1670–6.
- 33. Choudhury N, Mukherjee R, Yadav R, Liu Y, Wang W. Can machine learning approaches predict green purchase intention? -A study from Indian consumer perspective. Journal of Cleaner Production. 2024;456:142218.
- 34. Leong L-Y, Hew T-S, Ooi K-B, Chong AY-L. Predicting the antecedents of trust in social commerce – A hybrid structural equation modeling with neural network approach. Journal of Business Research. 2020;110:24–40.
- 35. Ong AKS, Aceron CC, Quimpo WJS, Ong DTU, Diaz JFT, German JD. Evaluation of preceding variables affecting behavioral use and acceptance of chord-enabled keyboard among students. Computers in Human Behavior Reports. 2024;16:100482.
- 36. Cortina JM. What is coefficient alpha? An examination of theory and applications. Journal of Applied Psychology. 1993;78(1):98–104.
- 37. Salih AM, Raisi‐Estabragh Z, Galazzo IB, Radeva P, Petersen SE, Lekadir K, et al. A Perspective on Explainable Artificial Intelligence Methods: SHAP and LIME. Advanced Intelligent Systems. 2024;7(1).
- 38. Chicco D, Jurman G. The Matthews correlation coefficient (MCC) should replace the ROC AUC as the standard metric for assessing binary classification. BioData Mining. 2023;16(1):4.
- 39. Zhou Y, Loi AM-W, Tan GW-H, Lo P-S, Lim W. The survey dataset of The Influence of theory of planned behaviour on purchase behaviour on social media. Data Brief. 2022;42:108239. pmid:35592771
- 40. Ajzen I. Perceived Behavioral Control, Self‐Efficacy, Locus of Control, and the Theory of Planned Behavior 1. J Applied Social Pyschol. 2002;32(4):665–83.
- 41. Henseler J, Ringle CM, Sarstedt M. A new criterion for assessing discriminant validity in variance-based structural equation modeling. J of the Acad Mark Sci. 2014;43(1):115–35.
- 42. Mude G, Undale S. Social media usage: A comparison between Generation Y and Generation Z in India. International Journal of E-Business Research. 2023;19(1):1–20.
- 43. Hu L, Bentler PM. Cutoff criteria for fit indexes in covariance structure analysis: Conventional criteria versus new alternatives. Structural Equation Modeling: A Multidisciplinary Journal. 1999;6(1):1–55.
- 44.
Hair JF, Black WC, Babin BJ, Anderson RE. Multivariate data analysis. 8th ed. Andover, UK: Cengage Learning. 2019.
- 45. Fornell C, Larcker DF. Evaluating Structural Equation Models with Unobservable variables and measurement error. Journal of Marketing Research. 1981;18(1):39.
- 46. Khan AE, Hasan MJ, Anjum H, Mohammed N, Momen S. Predicting life satisfaction using machine learning and explainable AI. Heliyon. 2024;10(10):e31158.
- 47. Cortes C, Vapnik V. Support-vector networks. Mach Learn. 1995;20(3):273–97.
- 48. Quinlan JR. Induction of Decision Trees. Mach Learn. 1986;1(1):81–106.
- 49. Freund Y, Schapire RE. A Decision-theoretic generalization of on-line learning and an application to boosting. Journal of Computer and System Sciences. 1997;55(1):119–39.
- 50. Friedman JH. Greedy function approximation: A gradient boosting machine. Ann Statist. 2001;29(5):1189–232.
- 51. Youden WJ. Index for rating diagnostic tests. Cancer. 1950;3(1):32–5. pmid:15405679
- 52.
Kumar R. Dataset of college student’s green purchase intention and behavior. Mendeley Data. 2022. https://doi.org/10.17632/b9hdy2swyy.1
- 53.
Hegselmann S, Buendia A, Lang H, Agrawal M, Jiang X, Sontag D. In: Proceedings of the 26th International Conference on Artificial Intelligence and Statistics, 2023. 5549–81.
- 54.
Fang X, Xu W, Tan FA, Zhang J, Hu Z, Qi Y. Large language models on tabular data: Prediction, generation, and understanding – A survey. Trans Mach Learn Res. 2024.
- 55.
Lewis P, Perez E, Piktus A, Petroni F, Karpukhin V, Goyal N. In: Advances in Neural Information Processing Systems, 2020. 9459–74.
- 56.
Flach P. Machine learning: The art and science of algorithms that make sense of data. Cambridge: Cambridge University Press. 2012.
- 57. Chicco D, Jurman G. The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genomics. 2020;21(1):6. pmid:31898477
- 58. Spais G, Jain V. Consumer Behavior’s evolution, emergence, and future in the AI age through the lens of MR, VR, XR, Metaverse, and Robotics. J of Consumer Behaviour. 2025;24(3):1275–99.
- 59. Podsakoff PM, MacKenzie SB, Lee J-Y, Podsakoff NP. Common method biases in behavioral research: a critical review of the literature and recommended remedies. J Appl Psychol. 2003;88(5):879–903. pmid:14516251