Welcome to the Amazon Recommender System project! This repository implements a recommendation system for Amazon products using Graph Neural Networks (GNNs). The system goes beyond traditional recommendation algorithms like collaborative filtering by leveraging advanced graph-based methods to uncover deeper insights into user-product interactions.
Recommendation systems play a vital role in personalizing user experiences. Amazon's ability to recommend products effectively relies on advanced algorithms. This project explores Graph Neural Networks to simulate such a system.
- Built using the Amazon 2018 dataset with a subset processed using the 5-kcore method.
- Utilizes GraphSAGE and Graph Attention Networks (GAT) for node embeddings and aggregation.
- Benchmarked against traditional models like KNN and SVD.
-
Graph Representation:
- Nodes: Users and products.
- Edges:
Reviews
: Connect users to products with ratings.Also Bought
: Connect products frequently purchased together.
-
Node Embeddings:
- Product Nodes: Generated using
sentence-transformer/all-MiniLM-L6-v2
for descriptions and one-hot encoded categories. - User Nodes: Initialized as blank and updated dynamically based on interactions.
- Product Nodes: Generated using
-
GNN Models:
- GraphSAGE: Learns inductive representations of nodes.
- GAT: Assigns attention weights to neighbors for better aggregation.
-
Explainability:
- Integrated gradients via Captum to interpret model predictions.
-
Evaluation:
- Metric: Root Mean Squared Error (RMSE).
- Comparison against traditional methods and a state-of-the-art Graph-based Hybrid Recommendation System (GHRS).
- Python 3.9
- PyTorch Geometric
- Hugging Face Transformers
- Other Python libraries (see
requirements.txt
)
- Clone the repository:
git clone https://github.com/aiden200/ARS.git cd ARS
- Install the required Packages:
pip install -r requirements.txt
. - Run the Cells in
ARS.ipynb
The data is already downloaded in the repository, so there is no need to uncomment the data collection line within the notebook.
Our paper: Final_paper