Products Recommendation System - create your private A.I model and use it on your website via the build-in API
Amazon has sales that are 20% to 30% higher thanks to their product recommendation system!
Why not do it on to your e-commerce website?
You can provide recommended products on a page of your website to your users based of your internal private data (eg: your products, your users ratings, your users purchases or interactions).
It will then display relevant list of products on your website while your user is browsing your Product Page and for none connected users (content-based filtering) and connected users (collaborative filtering).
Whatever CMS (Wordpress, Drupal, Prismic, Shopify...) or custom backend (Laravel, Symfony..) you currently use, if you have data, this project can be adapted and plugged to any source of data (CSV, SQL, MongoDB, Google Big Query...) and "your own machine learning model"
You have now the API (fastApi) to list recommended products to your website based on your own Machine Learning model.
This project aims to build a product recommendation system that predicts relevant products for users based on their previous interactions - COLLABORATIVE FILTERING - and without interactions - ITEM BASED FILTERING -.
The recommendations are served via a REST API, with a Web UI interface to test and visualize results. The project leverages various machine learning libraries and frameworks, including PyTorch and Spotlight, to train and deploy recommendation models.
- Product Recommendations: Predicts and provides personalized product recommendations for users.
- REST API: An API built with FastAPI to serve predictions, allowing easy integration with other applications.
- Interactive Web UI: A web interface built with Solara (React-based) for testing and exploring recommendations.
- Python: Core language for model development, API, and backend logic.
- PyTorch: Used as the backbone framework for building and training the recommendation model.
- Spotlight: A recommendation library based on PyTorch, used to simplify building and training collaborative filtering models.
- Pinecone: Used to create embeddings of data, indexing vector data and request vector data
- FastAPI: A high-performance API framework used to expose the recommendation model for external access.
- Solara: A React-based framework for building a Web UI, allowing users to interact with the recommendation model and visualize results.
- DVC: is an open-source tool for versioning datasets, managing machine learning models, and ensuring reproducibility with seamless Git integration.
- Exploration
- Preparation
- Evaluation
- CountVectorizer
- TfIdfVectorizer
solara run application/website/01-ml-recsys-content-based.py
Via Solara:
solara run application/website/02-ml-create-model.py
Or via API endpoint:
/generateModel?data_work_type=movies
Path of the model created
model/movies_users_rating_model.pth
solara run application/website/03-ml-display-rec.py
Or via API endpoint (e.g User ID:1 and recommended results up to 3):
/getRec/collaborative/movies/1/3
Test and doc of the API (FastAPI)
http://127.0.0.1:8765/docs