Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kaankvrck/kg-enhanced-recommender

Develop a personalized recommendation system using a Knowledge Graph to model relationships between users, products, and interactions. Utilizing Python, Neo4j, Cypher, and Py2neo, this project aims to enhance user satisfaction through efficient data management and advanced recommendation algorithms.
https://github.com/kaankvrck/kg-enhanced-recommender

cypher knowledge-graph neo4j py2neo python recommendation-system

Last synced: about 1 month ago
JSON representation

Develop a personalized recommendation system using a Knowledge Graph to model relationships between users, products, and interactions. Utilizing Python, Neo4j, Cypher, and Py2neo, this project aims to enhance user satisfaction through efficient data management and advanced recommendation algorithms.

Awesome Lists containing this project

README

        

# Knowledge Graph Based Recommendation System

## Project Overview
This project aims to develop a personalized recommendation system using a Knowledge Graph to model relationships between various entities such as users, products, and interactions. The recommendation system leverages graph-based algorithms and machine learning techniques to provide tailored suggestions to users based on their interactions and preferences.

## Table of Contents
- [Project Overview](#project-overview)
- [Dataset](#dataset)
- [Technologies and Tools](#technologies-and-tools)
- [Installation and Setup](#installation-and-setup)
- [Usage](#usage)
- [Model Training and Evaluation](#model-training-and-evaluation)
- [Results](#results)
- [Contributing](#contributing)
- [License](#license)

## Dataset
The dataset consists of three CSV files containing information about products, customers, and sales interactions. The columns for each file are as follows:

### Products
- Uniqe Id
- Product Name
- Brand Name
- Asin
- Category
- Upc Ean Code
- List Price
- Selling Price
- Quantity
- Model Number
- About Product
- Product Specification
- Technical Details
- Shipping Weight
- Product Dimensions
- Image
- Variants
- Sku
- Product Url
- Stock
- Product Details
- Dimensions
- Color
- Ingredients
- Direction To Use
- Is Amazon Seller
- Size Quantity Variant
- Product Description

### Customers
- Customer ID
- Age
- Gender
- Item Purchased
- Category
- Purchase Amount (USD)
- Location
- Size
- Color
- Season
- Review Rating
- Subscription Status
- Shipping Type
- Discount Applied
- Promo Code Used
- Previous Purchases
- Payment Method
- Frequency

### Sales
- user id
- product id
- Interaction type
- Time stamp

## Technologies and Tools
- **Programming Language:** Python
- **Graph Database:** Neo4j
- **Query Language:** Cypher
- **Libraries:** Py2neo, Pandas, Scikit-learn, Pyspark, Faker

## Installation and Setup
1. **Clone the repository:**
```bash
git clone https://github.com/yourusername/knowledge-graph-recommender.git
cd knowledge-graph-recommender
```
2. **Clone the repository:**
```bash
pip install -r requirements.txt
```
3. **Set up Neo4j:**
- Install Neo4j from [Neo4j Download Center](https://neo4j.com/download/).
- Start Neo4j and set up your database.
- Update the connection details in your code if necessary.

## Usage
1. **Prepare the data:**
- Run the `data_preparation.ipynb` notebook to load and preprocess the dataset.

2. **Train the model:**
- Execute the `model_training.ipynb` notebook to train the recommendation model using the ALS algorithm.

3. **Generate recommendations:**
- Use the `recommendations.ipynb` notebook to get personalized recommendations for users.

## Model Training and Evaluation
The project employs the Alternating Least Squares (ALS) algorithm for training the recommendation model. The evaluation metrics used to assess the model's performance include Root Mean Square Error (RMSE), Precision, Recall, and F1 Score.

### Model Training
The training process involves the following steps:
- Load and preprocess the data.
- Encode user and product IDs.
- Split the data into training and test sets.
- Train the ALS model using the training set.

### Model Evaluation
The model's performance is evaluated using the test set. The metrics calculated are:
- **RMSE**: Measures the difference between predicted and actual interactions.
- **Precision**: Measures the accuracy of the positive predictions.
- **Recall**: Measures the ability of the model to identify all relevant items.
- **F1 Score**: The harmonic mean of precision and recall.

## Results
The results of the recommendation model are presented in terms of the evaluation metrics. The recommendations generated by the model can be visualized using Neo4j Browser.

## Contributing
Contributions to this project are welcome. Please follow these steps to contribute:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit your changes (`git commit -am 'Add new feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.