Skip to content

Commit 40fd8d2

Browse files
authored
Merge pull request #1522 from ananas304/main
Improve and Add Missing README Files for Recommendation Models
2 parents 5ea7d06 + 4cc6866 commit 40fd8d2

File tree

15 files changed

+12640
-2224
lines changed

15 files changed

+12640
-2224
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Book Recommendation System
2+
3+
This repository contains two approaches to building a book recommendation system:
4+
5+
1. **Popularity-based Book Recommendation**
6+
2. **Collaborative-based Book Recommendation**
7+
8+
Both models use the same dataset, which includes information about books, users, and user ratings.
9+
10+
## Project Structure
11+
12+
- `Popularity_based_Book_Recommendation.ipynb`: A notebook that implements a popularity-based recommendation system.
13+
- `Collaborative_Book_Recommendation.ipynb`: A notebook that implements a collaborative filtering-based recommendation system.
14+
15+
## Dataset
16+
17+
The dataset used in both notebooks consists of three files:
18+
19+
1. **Books.csv**: Contains details about books such as ISBN, title, author, and publisher.
20+
2. **Users.csv**: Information about the users, including their unique ID, location, and age.
21+
3. **Ratings.csv**: User ratings for the books.
22+
23+
## Notebooks and Model Explanations
24+
25+
### 1. Popularity-based Book Recommendation
26+
27+
**Model Explanation:**
28+
29+
The popularity-based recommendation model ranks books based on their overall rating. The more ratings a book has, combined with the higher average rating, the more popular it is considered. The model does not take user preferences into account and simply recommends the same popular books to all users. Key steps include:
30+
31+
- **Data Preparation**: Loading the dataset and merging user ratings with book details.
32+
- **Popularity Calculation**: Sorting books based on the count of user ratings and their average rating.
33+
- **Recommendation Output**: Returning a list of the most popular books for recommendation.
34+
35+
This approach works well for general recommendations but lacks personalization.
36+
37+
### 2. Collaborative-based Book Recommendation
38+
39+
**Model Explanation:**
40+
41+
The collaborative-based recommendation model uses a more advanced approach, recommending books based on the preferences of similar users. This is done using **user-user collaborative filtering**, where the algorithm finds users with similar tastes and recommends books that those users have rated highly. The model works as follows:
42+
43+
- **Data Preparation**: Loading and cleaning the datasets (Books, Users, Ratings).
44+
- **User Similarity**: Calculating the similarity between users based on their book ratings using techniques like **cosine similarity**.
45+
- **Collaborative Filtering**: Based on the similarity scores, the model recommends books that similar users have liked but the target user hasn't yet rated.
46+
- **Recommendation Output**: Personalized book recommendations for each user based on their preferences and the behavior of similar users.
47+
48+
This method is highly personalized and usually yields better results than popularity-based systems, but it requires more data and computational resources.
49+
50+
## How to Run
51+
52+
1. Clone the repository.
53+
2. Install the necessary dependencies (`pandas`, `numpy`, `matplotlib`, `seaborn`).
54+
3. Open the notebooks and run the cells in sequence.
55+
56+
## Conclusion
57+
58+
These two models offer different strategies for recommending books. The **popularity-based model** is simple and effective for recommending top-rated books to everyone, while the **collaborative filtering model** offers personalized recommendations based on user behavior and preferences.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
numpy
2+
pandas
3+
matplotlib
4+
seaborn

0 commit comments

Comments
 (0)