Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuickRank-AI

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.


Problem Statement

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.


Dataset

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

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.


Project Pipeline

Customer Events ↓ Feature Engineering ↓ Learning-to-Rank Dataset ↓ Popularity Baseline ↓ LambdaMART ↓ XGBoost Ranker ↓ Performance Evaluation ↓ SHAP Explainability


Feature Engineering

Product Features

  • Product popularity
  • Conversion rate
  • Purchase count
  • Cart count
  • View count
  • Inventory
  • Price
  • Discount
  • Delivery time

Customer Features

  • Total interactions
  • Purchase ratio
  • Cart ratio
  • Product diversity
  • Engagement score

Ranking Features

  • Product popularity score
  • Customer engagement
  • Historical interaction relevance

Models

1. Popularity Baseline

Ranks products according to overall popularity.

Used as a benchmark.


2. LambdaMART

LightGBM implementation of Learning-to-Rank.

Optimizes NDCG directly.


3. XGBoost Ranker

Gradient Boosted Ranking Trees using pairwise ranking objective.


Evaluation Metrics

The models are evaluated using:

  • NDCG@10
  • MAP
  • Precision@10

using 5-Fold Group Cross Validation.


Explainability

The project uses SHAP to explain model predictions.

Generated visualizations include:

  • SHAP Summary Plot
  • SHAP Feature Importance
  • Global Feature Ranking

Results

The machine learning ranking models outperform the popularity baseline across all ranking metrics.

Model comparison includes:

  • Popularity Baseline
  • LambdaMART
  • XGBoost Ranker

Repository Structure


QuickRank-AI/

data/

assets/

notebooks/

QuickRank_AI.ipynb

README.md

requirements.txt


Installation

git clone https://github.com/anvi-tandel/QuickRank-AI.git

cd QuickRank-AI

pip install -r requirements.txt

Run

Open

notebooks/QuickRank_AI.ipynb

Run all cells.


Future Improvements

  • Neural Learning-to-Rank
  • DeepFM
  • Session-based recommendations
  • Real-time ranking
  • Personalized search

Tech Stack

  • Python
  • Pandas
  • NumPy
  • LightGBM
  • XGBoost
  • SHAP
  • Scikit-learn
  • Matplotlib

Author

Anvi Tandel

Final Year Undergraduate

Indian Institute of Technology (BHU), Varanasi

About

AI-powered Learning-to-Rank system for personalized quick-commerce product recommendations using LambdaMART, XGBoost Ranker, and SHAP explainability.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages