An advanced analysis of eCommerce customer behavior using machine learning and deep learning models on real-world data from a large multi-category online store.
Source: Kaggle Dataset
- Size: ~285 million events over 7 months (Oct 2019 - Apr 2020)
- Event Types:
view- Product viewedcart- Added to cartremove_from_cart- Removed from cartpurchase- Purchased product
- Features:
event_time,event_type,product_id,category_id,category_codebrand,price,user_id,user_session
Predict customer behavior (view, add to cart, purchase) during online shopping sessions using time series forecasting, machine learning, and deep learning.
- Missing values imputation
- Linear interpolation for gaps
- Detrending & deseasonalization
- Train/Test Split (80/20)
- Price distribution (Boxplots, Histograms, KDE)
- Event frequency over time
- Seasonal decomposition (Additive & Multiplicative)
- ACF & PACF plots for time dependencies
| Model | Accuracy |
|---|---|
| Random Forest | 50% |
| Logistic Regression | 43% |
| CatBoost | 50% |
| XGBoost | 50% |
| Model | Accuracy |
|---|---|
| LSTM | 96.05% |
| GRU | 96.06% |
| Transformer | 96.05% |
| Temporal CNN (TCN) | 96.05% |
- ML Models: Grid Search, Random Search
- DL Models: Adam Optimizer, Dropout, Label Encoding
- Evaluation with Confusion Matrix, Accuracy, Precision, Recall, F1-Score
- ✅ Best Machine Learning Model: XGBoost (50%)
- ✅ Best Deep Learning Model: GRU (96.06%)
- Deep learning models significantly outperformed machine learning models in predictive accuracy.
Combining time series forecasting, machine learning, and deep learning techniques provides a robust predictive system for understanding customer behavior in eCommerce. GRU showed the best balance between accuracy and efficiency.
- Dataset: Open CDP Project
- Special thanks to REES46 Marketing Platform for providing the dataset.