Buye Lens: Predictive E-Commerce Marketing Using Optimized KNN Learning

The exponential growth of e-commerce platforms has intensified competition, making precise customer targeting essential for maximizing conversion rates and return on marketing investment. This paper proposes a robust machine learning framework using the K-Nearest Neighbors (KNN) algorithm to predict online shoppers' purchase intentions. Utilizing the UCI Online Shoppers Purchasing Intention Dataset comprising 12,330 sessions and 18 features, we develop a complete end-to-end pipeline encompassing data loading, preprocessing, exploratory data analysis, feature engineering, model development, hyperparameter tuning, and deployment-ready evaluation. Missing values were imputed using column means, and duplicate records were removed, resulting in a refined dataset of 12,205 instances. Numerical features were scaled using MinMaxScaler to optimize distance-based computations inherent to KNN. Hyperparameter tuning via GridSearchCV identified optimal values for the number of neighbors, weighting scheme, and distance metric. The final model employing distance-based weighting achieved a test accuracy of 75.75%. The study demonstrates that KNN, combined with careful preprocessing and threshold tuning, serves as a practical and interpretable solution for precise e-commerce marketing.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-05-31
DOI
https://doi.org/10.5281/zenodo.20476273
Primary Topic
Customer churn and segmentation
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Buye Lens: Predictive E-Commerce Marketing Using Optimized KNN Learning

Dheeraj Kharvi
Zenodo (CERN European Organization for Nuclear Research)
Customer churn and segmentation
article

Buye Lens: Predictive E-Commerce Marketing Using Optimized KNN Learning

Dheeraj Kharvi
article en

Abstract

The exponential growth of e-commerce platforms has intensified competition, making precise customer targeting essential for maximizing conversion rates and return on marketing investment. This paper proposes a robust machine learning framework using the K-Nearest Neighbors (KNN) algorithm to predict online shoppers' purchase intentions. Utilizing the UCI Online Shoppers Purchasing Intention Dataset comprising 12,330 sessions and 18 features, we develop a complete end-to-end pipeline encompassing data loading, preprocessing, exploratory data analysis, feature engineering, model development, hyperparameter tuning, and deployment-ready evaluation. Missing values were imputed using column means, and duplicate records were removed, resulting in a refined dataset of 12,205 instances. Numerical features were scaled using MinMaxScaler to optimize distance-based computations inherent to KNN. Hyperparameter tuning via GridSearchCV identified optimal values for the number of neighbors, weighting scheme, and distance metric. The final model employing distance-based weighting achieved a test accuracy of 75.75%. The study demonstrates that KNN, combined with careful preprocessing and threshold tuning, serves as a practical and interpretable solution for precise e-commerce marketing.

Zenodo (CERN European Organization for Nuclear Research)
Chanakya National Law University (IN)
Industry, innovation and infrastructure
Openalex Percentile: Top 4%
Customer churn and segmentation
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.