A Flask-based web application that recommends books to users using collaborative filtering and content-based filtering techniques powered by scikit-surprise and scikit-learn.
- Demographic-based initial suggestions – recommends books based on user age and location similarity
- Collaborative filtering – uses KNN with means (via Surprise) to generate personalized recommendations from rating history
- Content-based filtering – uses TF-IDF and cosine similarity on book metadata
- Interactive web UI – built with Flask and Jinja2 templates
flaskr/
├── __init__.py # Flask app factory
├── main.py # Routes and recommendation logic
├── static/
│ ├── book_data.csv # Book metadata
│ ├── book_info.csv # Additional book info
│ └── Users.csv # User demographic data
├── templates/
│ └── index.html # Main UI template
└── tools/
└── data_tool.py # Data loading & helper utilities
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtflask --app flaskr run --debugThen open your browser at http://127.0.0.1:5000.
- Python 3.10+
- See
requirements.txtfor full list of dependencies