An AI-powered Learning-to-Rank system for quick-commerce product recommendation using customer interaction data.
This project predicts the ranking of products for each customer using machine learning ranking algorithms and explains ranking decisions using SHAP.
Quick-commerce platforms such as Blinkit, Zepto and Instamart contain thousands of products.
Showing every product equally leads to:
- Poor customer experience
- Lower conversion rates
- Reduced revenue
The objective is to learn an optimal ranking of products for every customer based on historical interactions.
RetailRocket E-Commerce Dataset
The dataset contains anonymized customer interactions collected from an online retailer.
Files used:
- events.csv
- item_properties_part1.csv
- item_properties_part2.csv
- category_tree.csv
Interaction types:
- View
- Add to Cart
- Purchase
Download the dataset from Kaggle:
https://www.kaggle.com/datasets/retailrocket/ecommerce-dataset
After downloading, create the following directory:
QuickRank-AI/
│
├── data/
│ ├── events.csv
│ ├── item_properties_part1.csv
│ ├── item_properties_part2.csv
│ └── category_tree.csv
Then run the notebook.
Customer Events ↓ Feature Engineering ↓ Learning-to-Rank Dataset ↓ Popularity Baseline ↓ LambdaMART ↓ XGBoost Ranker ↓ Performance Evaluation ↓ SHAP Explainability
- Product popularity
- Conversion rate
- Purchase count
- Cart count
- View count
- Inventory
- Price
- Discount
- Delivery time
- Total interactions
- Purchase ratio
- Cart ratio
- Product diversity
- Engagement score
- Product popularity score
- Customer engagement
- Historical interaction relevance
Ranks products according to overall popularity.
Used as a benchmark.
LightGBM implementation of Learning-to-Rank.
Optimizes NDCG directly.
Gradient Boosted Ranking Trees using pairwise ranking objective.
The models are evaluated using:
- NDCG@10
- MAP
- Precision@10
using 5-Fold Group Cross Validation.
The project uses SHAP to explain model predictions.
Generated visualizations include:
- SHAP Summary Plot
- SHAP Feature Importance
- Global Feature Ranking
The machine learning ranking models outperform the popularity baseline across all ranking metrics.
Model comparison includes:
- Popularity Baseline
- LambdaMART
- XGBoost Ranker
QuickRank-AI/
data/
assets/
notebooks/
QuickRank_AI.ipynb
README.md
requirements.txt
git clone https://github.com/anvi-tandel/QuickRank-AI.git
cd QuickRank-AI
pip install -r requirements.txtOpen
notebooks/QuickRank_AI.ipynb
Run all cells.
- Neural Learning-to-Rank
- DeepFM
- Session-based recommendations
- Real-time ranking
- Personalized search
- Python
- Pandas
- NumPy
- LightGBM
- XGBoost
- SHAP
- Scikit-learn
- Matplotlib
Anvi Tandel
Final Year Undergraduate
Indian Institute of Technology (BHU), Varanasi