https://github.com/rishi-gupta-data/book-recommendation-system
https://github.com/rishi-gupta-data/book-recommendation-system
pandas python3 scikit-learn
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rishi-gupta-data/book-recommendation-system
- Owner: Rishi-gupta-data
- License: mit
- Created: 2024-11-14T14:02:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-19T07:50:31.000Z (over 1 year ago)
- Last Synced: 2025-03-17T04:48:08.387Z (over 1 year ago)
- Topics: pandas, python3, scikit-learn
- Language: Jupyter Notebook
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Book Recommendation System
A sophisticated book recommendation engine powered by collaborative filtering techniques (KNN & SVD), featuring an intuitive web interface.
---
## โจ Features
- ๐ค **Intelligent Recommendations** using Collaborative Filtering (User-User & Item-Item)
- ๐ **Similar Books Discovery** via ISBN
- ๐ **Interactive Web Interface** (Flask-based)
- ๐ **API Endpoints** with Rate Limiting
- ๐ **Performance Metrics** (RMSE, MAE, Precision@K)
- ๐ **Efficient Data Processing Pipeline**
- ๐๏ธ **Well-Structured Codebase** for scalability
---
## ๐ ๏ธ Tech Stack
| Category | Tools/Libraries |
|--------------------|-------------------------------|
| ๐จโ๐ป **Language** | Python 3.8+ |
| โ๏ธ **Framework** | Flask |
| ๐ **Data Handling**| Pandas, NumPy, scikit-learn |
| ๐ **Recommenders** | KNN (Collaborative), SVD (Matrix Factorization) |
| ๐จ **Frontend** | HTML, CSS, Bootstrap, Font Awesome |
---
## ๐ Project Structure
๐ฆ **BookRecommendationSystem/**
โ
โโโ ๐ **data/**
โ โโโ ๐ **raw/** # Original datasets (Books, Ratings, Users)
โ โโโ ๐ **processed/** # Cleaned & preprocessed data
โ
โโโ ๐ **frontend/**
โ โโโ ๐จ **static/** # CSS, JS, assets
โ โโโ ๐ **templates/** # HTML files (Jinja2 templates)
โ
โโโ ๐พ **models/** # Trained KNN & SVD models
โ
โโโ ๐ **notebooks/** # Jupyter notebooks for experiments
โ
โโโ ๐ง **src/** # Core Python modules (ETL, recommenders)
โ
โโโ ๐ **app.py** # Flask entry point
---
## ๐ Workflow Overview
```mermaid
flowchart TD
A([๐ User Input: Book/ISBN/User ID]):::start --> B{{๐ Data Processing}}
B --> C[๐งน Clean & Preprocess Data]
C --> D[๐ฆ Load Models: KNN / SVD]
D --> E[๐ค Generate Recommendations]
E --> F[๐ Evaluate with Metrics]
E --> G[๐ Render Web Interface]
G --> H([๐ Display Recommended Books]):::end_node
classDef start fill:#00b894,stroke:#fff,color:#fff,stroke-width:2px
classDef process fill:#0984e3,stroke:#fff,color:#fff
classDef decision fill:#fdcb6e,stroke:#2d3436,color:#2d3436
classDef analysis fill:#6c5ce7,stroke:#fff,color:#fff
classDef end_node fill:#d63031,stroke:#fff,color:#fff,stroke-width:2px
B:::decision
C:::process
D:::process
E:::process
F:::analysis
G:::process
````
---
## ๐ง Models Used
### 1๏ธโฃ **KNN (Collaborative Filtering)**
* Uses similarity between users/books based on ratings.
* Finds *nearest neighbors* (similar readers or books).
* Recommends books that similar users liked.
### 2๏ธโฃ **SVD (Matrix Factorization)**
* Decomposes the User-Item rating matrix into latent factors.
* Captures *hidden patterns* in reading behavior.
* Generates **personalized recommendations** even for sparse data.
---
## ๐ Data Pipeline
```mermaid
flowchart LR
A([๐ฅ Raw Data: Books + Users + Ratings]) --> B[๐งน Preprocessing: Missing Values, Normalization]
B --> C[๐๏ธ Train-Test Split]
C --> D1[๐ KNN Model Training]
C --> D2[๐ SVD Model Training]
D1 --> E[๐ Evaluation]
D2 --> E
E --> F([๐ Final Recommendation Engine]):::end_node
%% ๐จ Styling
classDef end_node fill:#d63031,stroke:#fff,color:#fff,stroke-width:2px;
```
## ๐ How to Run
1. Install the required dependencies:
```bash
pip install -r requirements.txt
```
2. Run the application:
```bash
python src/webapp/app.py
```
3. Open your browser and visit:
๐ [http://localhost:5000](http://localhost:5000)
---
## ๐ Evaluation Metrics
**RMSE & MAE** โ to measure prediction errors.
**Precision@K & Recall@K** โ to evaluate recommendation accuracy.
**Hit Rate** โ to measure how often recommended books match user preferences.
## ๐ธ Screenshots




## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.