Welcome to the Book Recommendation System! This project leverages deep learning to provide personalized book recommendations based on user preferences. By learning complex interactions between users and books, the system predicts ratings for unseen books and suggests the most relevant ones to each user. It's a hands-on demonstration of building and deploying a collaborative filtering-based recommendation system.
- Deep Learning-Based Model: A neural network with embeddings to represent users and books in a shared feature space.
- Scalable Architecture: Designed to handle thousands of users and books efficiently.
- Interactive Web Interface: Built using Streamlit for seamless user interaction.
- Comprehensive Metrics: Evaluation using MAE and RMSE to measure model accuracy.
- Preprocessed Datasets: Encoded user and book IDs for optimized training.
├── data/
│ ├── books.csv # Metadata of books
│ ├── ratings.csv # User-book ratings
├── main.py # Main script for training and recommendation
├── model.py # Defines the recommendation model architecture
├── best_model.h5 # Trained recommendation model saved as an HDF5 file
├── utils.py # Helper functions for data loading and processing
├── app.py # Streamlit app for interactive recommendations
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- The system uses two datasets:
ratings.csv
: Contains user ratings for books (user_id, book_id, rating).books.csv
: Metadata about books (book_id, title, authors).
- Encode user and book IDs into integers for neural network processing.
- Split the data into training and validation sets (80/20 split).
The recommendation model is built using TensorFlow and includes:
- Embeddings for users and books to capture their latent features.
- Dense Layers to learn complex interactions between users and books.
- Dropout Layers to prevent overfitting.
- Output Layer to predict the rating for a user-book pair.
- Loss Function: Mean Squared Error (MSE)
- Optimizer: Adam
- Metrics: Mean Absolute Error (MAE)
- The model is trained to minimize MSE and validated using MAE and RMSE.
- For a given user, the system predicts ratings for all books.
- Books with the highest predicted ratings are recommended.
- The system is deployed using Streamlit, offering an intuitive web interface for:
- Inputting a user ID.
- Viewing top book recommendations for the user.
- MAE (Mean Absolute Error): 0.6387
- RMSE (Root Mean Squared Error): 0.8333
These metrics indicate that the model provides accurate recommendations, with minimal deviation from actual user ratings.
git clone https://github.com/bautistao2/book-recommendation-system.git
cd book-recommendation-system
Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # For Linux/Mac
venv\Scripts\activate # For Windows
pip install -r requirements.txt
Launch the interactive recommendation system:
streamlit run app.py
- Python: Core programming language.
- TensorFlow/Keras: For building and training the recommendation model.
- Pandas: Data manipulation and preprocessing.
- Scikit-learn: For splitting data into training and validation sets.
- Streamlit: Web-based deployment for interactive recommendations.
- Matplotlib: For data visualization (optional).
- Hyperparameter Tuning:
- Optimize embedding dimensions, dropout rates, and layer sizes.
- Cold Start Problem:
- Implement content-based filtering for new users or books.
- Incorporate Additional Features:
- Add genres, publication year, and user demographics.
- Scalability:
- Adapt the system to handle millions of users and books.
For questions, feedback, or collaboration, feel free to reach out:
- Name: Ilyd Bautista
- Email: [email protected]
- GitHub: GitHub Profile
- LinkedIn: LinkedIn Profile
This project is licensed under the MIT License. See the license.txt file for details.
Enjoy exploring the world of personalized book recommendations! 📖✨