Code Monkey home page Code Monkey logo

recommendation_engine's Introduction

A Recommendation engine for recommending product bundles

Introduction

In this notebook, I develop a recommendation engine for an online shop and evaluate the results. The original dataset is taken from Kaggle.

Goal

The goal of this project is to recommend products that might be interesting for customers to buy in bundles.

The dataset contains two main types of information that can be leveraged for a recommendation system.

  1. Product Descriptions: Each product is described in words.
  2. CustomerID information: Each purchase is associated with the respective customer
  3. Information about items, their quantity and price that were bought together

Number 1 enables us to segment products into classes of products.
Number 2 allows us to (a) identify customers with similar interests, and (b) associate products and classes of products with those customers.

By combining 1 and 2, one can, for each customer A

  • identify another customer B that has the most similar interests to customer A
  • identify the product classes associated with customer A's purchased items
  • recommend products from these classes to customer B

For the product segmentation, I create word embeddings from the Describtion data column and apply an Agglomerative Clustering algorithm to group the products into classes.
The customer similarity is quantified using the concept of cosine similarity to find each customer's "next neighbor".

For the final recommendation, I test two methods:

  1. I identify the TOP 5 product-classes (i.e. the product classes from which the most purchases were made) of the "next neighbor" and recommend one product from each category.
  2. I identify the single TOP product-class of the "next neighbor" and recommend 5 products from this class.

The methods are also tested against a "dummy" model, whis is: 5 products are drawn from a random product-class.

Project Files

  • data/: The directory containing the dataset files (original input from Kaggle as *.csv and cleaned data as *.pkl).
  • EDA_and_cleaning.ipynb: This notebook contains the preparation of the data.
  • Recommender.ipynb: This notebook contains the recommendation engine.
  • Price_prediction.ipynb: This notebook contains a regression model for UnitPrice predictions.

Installation

  1. Clone this repository:

    git clone https://github.com/karol-pa/Recommendation_Engine.git
  2. Set up your enviornment using the provided requirement file:

    pyenv local 3.11.3
    python -m venv .venv
    source .venv/bin/activate
    pip install --upgrade pip
    pip install -r requirements.txt
  3. Run the notebooks in Jupyter Lab or VSCode

Contributions

This project was conducted by Dr. Karol Palczynski.

recommendation_engine's People

Contributors

karol-pa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.