Skip to content

The Retail Recommender System is a Shiny-based web application that provides recommendations for cross-sell opportunities using association rule mining. Built with R, it analyzes customer transaction data, extracts purchasing patterns, and generates rules for cross-sell recommendations.

Notifications You must be signed in to change notification settings

Sabareh/Retail-Recommender-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retail Recommender System

Overview

The Retail Recommender System is a Shiny-based web application that provides recommendations for cross-sell opportunities using association rule mining. Built with R, it analyzes customer transaction data, extracts purchasing patterns, and generates rules for cross-sell recommendations. The app is designed to provide business insights, particularly in retail environments, by leveraging market basket analysis.

Features

  • Transaction Data Analysis: Loads transactional data from CSV files and processes it using the arules package for association rule mining.
  • Cross-Sell Rule Discovery: Applies the Apriori algorithm to identify frequent itemsets and generates rules to highlight cross-sell opportunities.
  • Interactive Visualization: Provides interactive plots and graphs to explore the generated rules.
  • Customizable Thresholds: Allows users to adjust support and confidence thresholds via a simple UI to fine-tune rule generation.
  • Explore Panel: View and analyze the generated rules based on support, confidence, and lift.

Technologies Used

  • R Programming Language
    • shiny: For creating the web application.
    • arules: For implementing association rule mining.
    • plotly: For creating interactive plots.
    • igraph: For visualizing rule relationships using graphs.
    • arulesViz: For visualizing association rules.

Installation

To run this project locally, follow these steps:

  1. Clone the Repository

    git clone https://github.com/sabareh/retail-recommender-system.git
    cd retail-recommender-system
  2. Install Dependencies Make sure you have R installed on your machine. Install the required packages:

    install.packages(c("shiny", "plotly", "arules", "igraph", "arulesViz", "DT"))
  3. Run the Application

    runApp('Recommender-App')
  4. Access the App Once the application starts, access it by navigating to http://127.0.0.1:6849 in your web browser, where XXXX is the port number displayed in the console.

Project Structure

Retail-Recommender-System/
│
├── data/
│   └── data.csv             # Sample transaction data
├── Recommender-App/
│   ├── app.R                # Main Shiny app file
│   └── ...
├── README.md                # Project documentation
└── LICENSE                  # License information

Sample Data

Ensure the data.csv file follows the below structure:

order_id product_id
1 A
1 B
2 A
2 C
3 B
3 D

You can modify the data to fit your retail environment, using unique identifiers for products and orders.

How It Works

  1. Transaction Loading: The app reads in transaction data from a CSV file.
  2. Apriori Algorithm: The Apriori algorithm finds frequent itemsets and generates rules with specified support and confidence thresholds.
  3. Visualization: The app displays rules in tabular form and as interactive graphs, allowing for deeper exploration.

Screenshots

1. Cross-Sell Rules Table

Rules Table

2. Rule Graph

Rule Graph

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new feature branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -m 'Add feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any inquiries or issues, feel free to reach out:


This README provides a detailed overview of your project, including instructions for installation, usage, and contribution, as well as a sample structure and visualizations to make the repository more accessible for users and contributors.

About

The Retail Recommender System is a Shiny-based web application that provides recommendations for cross-sell opportunities using association rule mining. Built with R, it analyzes customer transaction data, extracts purchasing patterns, and generates rules for cross-sell recommendations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages