This repository implements a recommender system microservice on top of an example database of film rentals. The recommender is accessible as an API via the browser.
The recommender is a basic collaborative filtering method based on latent semantic analysis - a truncated singular value decomposition of a TFiDF transformed customer-rental matrix.
Note that the results are nonsensical because the data is just an example database, but the method should in principle work!
- 🐘 PostgreSQL, with example database from xzilla/pagila; see also the schema
- 🐻❄️ polars for running queries and dataframe operations
- 📈 scikit-learn for creating a simple product recommender
- ⚡ FastAPI for turning this into a microservice
- 🐋 Docker for containerizing the whole application
- Install docker
- Clone this repository
- Run
docker compose up
- Navigate to localhost:8000/recommend/1?n=5 or see the docs at localhost:8000/docs
For different installation methods and development, see here.
The repo is structured as follows:
I wanted to try out FastAPI and Docker, and for me having a specific project is always the best motivation to learn new stuff -- even if it's just a toy project!