CLASSIFICATION STUDY · 2026
Online Shopper
Purchase Intention
Prediction
A comparative machine learning study predicting whether an e-commerce browsing session will result in revenue.
RESEARCH OVERVIEW
Can browsing behaviour reveal purchase intent?
The study uses session-level behavioural and technical attributes to distinguish purchasers from non-purchasers. Because only 15.63% of cleaned sessions produced revenue, accuracy alone would be misleading; the analysis prioritised ROC-AUC, balanced accuracy, recall, precision, and F1.
Research questionWhich supervised machine learning technique most effectively predicts online purchase intention from session behaviour?
01 · DATASET
From raw sessions to reliable evidence.
Target distribution
Revenue is strongly imbalanced.
The majority baseline reaches 84.38% accuracy while detecting zero purchases—showing why accuracy cannot be the only success measure.02 · EXPLORATORY ANALYSIS
What the sessions reveal.
New visitors convert more
24.9%New visitors had a higher purchase rate than returning visitors at 14.1%.
November leads conversion
25.5%The monthly purchase rate peaked in November, compared with only 1.66% in February.
Page value dominates
#1PageValues was the most important predictor in all three fitted models.
Non-normal behaviour
10/10Every numerical variable showed evidence of non-normality in sampled Shapiro-Wilk tests.
MONTHLY PURCHASE RATE
Conversion rises toward November.
Strongest paired correlations
Chi-square findings
03 · METHODOLOGY
A reproducible comparison.
Up-sampling and weighting
caret models used up-sampling within resampling. XGBoost used a positive-class weight of 5.395 to give purchase sessions appropriate influence.
Controlled experimentation
A fixed random seed of 12345, stratified data partitioning, saved cross-validation predictions, and parallel processing supported repeatable comparisons.
ROC-AUC as primary metric
The minority purchase class and asymmetric business value made discrimination and recall more useful than raw accuracy alone.
04 · MODEL PERFORMANCE
Three models. Different strengths.
SELECTED MODEL
XGBoost
Best overall discrimination and purchase recall.
05 · INTERPRETATION
Page value drives the prediction.
Engagement quality matters more than simple volume.
PageValues was overwhelmingly influential, while exit behaviour, product engagement, month, traffic source, and visitor type added useful signals. The result suggests that where visitors navigate—and the commercial value of those pages—matters more than page counts alone.
“The strongest model is not necessarily the one with the highest accuracy; it is the one that best supports the prediction objective.”
06 · CONCLUSION
XGBoost provided the best overall purchase-intention discrimination.
With a test ROC-AUC of 0.9296 and recall of 0.8531, XGBoost was selected as the best model by the study’s primary criterion. Random Forest remained valuable where precision and specificity were more important.
The analysis also shows why class-aware evaluation is essential: the majority baseline appeared accurate at 84.38% but failed to identify a single purchasing session.