A hybrid recommendation system that combines content-based and collaborative filtering approaches to provide personalized product recommendations. The system analyzes product details, user ratings, and review data to suggest relevant items to users.
- Content-based filtering using product details and reviews
- Collaborative filtering using user-item interactions
- Hybrid recommendation approach combining both methods
- Extensive data preprocessing and cleaning
- Detailed exploratory data analysis (EDA)
- Performance evaluation metrics
- Interactive Dashboard with streamlit to generate recommendations based on user-id
The system uses an Amazon Sales Dataset with the following key features:
- Product information (ID, name, category, price [actual and discounted])
- User reviews and ratings
- Product descriptions
- Category hierarchies
You can clone this repository locally using CLI or download it as a zip file.
git clone https://github.com/Aakarsh204/Recommender-System.gitTo run the Streamlit App Dashboard, you need to create an Anaconda environment
conda create --name Recommender-System --file requirements.txtThis will install all the dependencies that you require to get started.
After they have finished installation, download the Collaborative Filter Model and Content Based Similarity Matrix from my GDrive
Extract the models to the main working directory
Also extract the python scripts to the main working directory
Download the dataset from this link
Extract this to the main working directory as well. So far your workspace should look like this:
Recommender-System
|
+-- cfmodel.pkl
|
+-- cosine_matrix.npz
|
+-- amazon.csv
|
+-- requirements.txt
|
+-- app.py
|
.... Rest of your scripts
Once you are done setting up, activate your conda environment
conda activate Recommender-SystemNow inside the environment, run this command
streamlit run app.pyThis should start up the streamlit app in your local browser. Happy Shopping!
pandas
numpy
matplotlib
seaborn
scipy
scikit-learn
nltk
surprise
streamlit
plotly- Text cleaning and normalization
- Handling missing values
- Price formatting
- Category hierarchy splitting
- Rating weight calculation
- Label encoding for user and product IDs
- Used TF-IDF vectorization for product details
- Computed cosine similarity between products
- Recommended products based on item-item similarity
- Implemented SVD (Singular Value Decomposition)
- Used the Surprise library for model training
- Cross-validation for model evaluation
- Combines content-based and collaborative filtering scores
- Weighted recommendation scores
- Configurable weights for each approach
- RMSE (Root Mean Square Error)
- MAE (Mean Absolute Error)
- Average Precision Score
- The dataset had a unique format, where each product had comma separated user values
- Splitting the user values often led to many predictions being the same item, but from different users
- Going from experimenting in Colab to modularizing the code
- Debugging the errors in the streamlit dashboard
Aakarsh Pathak
I’m a passionate developer focused on building and sharing machine learning and data science projects to advance my knowledge and real-world applications.
My linkedIn: link



