A DSA-based E-Commerce Product Recommendation Engine built using Python, Streamlit, HashMaps, Heaps, Sorting Algorithms, and Recommendation Logic. The system analyzes user purchases, search history, cart activity, and product ratings to generate personalized product recommendations.
Online shopping platforms contain thousands of products, making product discovery difficult. Recommendation systems improve user experience by suggesting relevant products based on customer behavior.
This project simulates how modern e-commerce platforms such as Amazon, Flipkart, Myntra, and Netflix recommend products and content to users.
Build an end-to-end recommendation engine that:
- Stores products and user interactions
- Analyzes purchases, searches, and cart activity
- Calculates recommendation scores
- Ranks products using DSA techniques
- Generates personalized recommendations
- Displays recommendations through a professional Streamlit UI
Recommendation engines are widely used in:
- E-Commerce Platforms
- OTT Streaming Platforms
- Online Marketplaces
- Digital Advertising Systems
- Retail Analytics Systems
Business Benefits:
- Increased sales
- Better customer retention
- Improved product discovery
- Higher engagement
- Increased conversion rates
- Arrays / Lists
- HashMaps / Dictionaries
- Sets
- Sorting Algorithms
- Heap / Priority Queue
- Similarity Scoring
- Searching
- Ranking Algorithms
User Activity → Purchase History → Search History → Cart Activity → Similarity Scoring → Ranking Engine → Priority Queue → Top-N Recommendations
Input Layer
- Product Catalog
- Product Categories
- Product Ratings
- User Purchases
- User Searches
- User Cart Data
Processing Layer
- Store Product Information
- Store User Activity
- Calculate Recommendation Scores
- Filter Purchased Products
- Rank Products
- Retrieve Top Recommendations
Output Layer
- Personalized Recommendations
- Similar Products
- Category Recommendations
- Recommendation Reports
E-Commerce-Product-Recommendation-Engine/
|
|-- data/
| |-- products.csv
| |-- users.csv
|
|
|-- outputs/
| |-- recommendation_report.txt
| |-- sample_output.txt
|
|
|-- images/
|
|
|-- docs/
| |-- architecture.md
| |-- algorithm.md
| |-- future_enhancements.md
| `-- project_report.md
|
|-- app.py
|-- requirements.txt
|-- README.md
`-- .gitignore
Contains:
- Product ID
- Product Name
- Category
- Rating
Contains:
- User ID
- Purchase History
- Search History
- Cart Activity
The recommendation engine calculates scores using:
Category Match = +5
Search Match = +3
Cart Match = +4
Product Rating = +Rating Score
Final Score = Category Score + Search Score + Cart Score + Rating Score
Products already purchased by the user are excluded from recommendations.
Step 1
Load product catalog.
Step 2
Load user interaction data.
Step 3
Identify purchased categories.
Step 4
Calculate recommendation scores.
Step 5
Filter already purchased products.
Step 6
Sort products by score.
Step 7
Use Heap/Priority Queue to retrieve Top-N products.
Step 8
Display recommendations.
Recommendation Scoring
O(n)
Top-N Heap Ranking
O(n log k)
Overall Complexity
O(n log k)
Where:
n = Number of Products
k = Number of Recommended Products
- Product Recommendation Engine
- Similar Product Finder
- Category-Based Recommendations
- Purchase History Analysis
- Search History Analysis
- Cart-Based Recommendations
- Product Ranking System
- Top-N Recommendation Retrieval
- Interactive Streamlit Dashboard
- Professional Neon UI
Features:
- Neon Cyberpunk Theme
- Interactive Sidebar
- Product Tables
- Recommendation Dashboard
- Similar Product Explorer
- Category Ranking Viewer
Clone Repository
git clone https://github.com/yourusername/E-Commerce-Product-Recommendation-Engine.git
Move into Project Folder
cd E-Commerce-Product-Recommendation-Engine
Install Dependencies
pip install -r requirements.txt
streamlit run app.py
Recommended Products
- Sony Headphones
- MacBook Air
- Dell XPS
- Apple Watch
- Samsung S24
Category Recommendations
Electronics
- Sony Headphones
- Apple Watch
- Noise Smartwatch
Similar Products
iPhone 15
- Samsung S24
- OnePlus 12
architecture.md
System architecture and workflow.
algorithm.md
Recommendation algorithm explanation.
project_report.md
Complete project report.
future_enhancements.md
Future project improvements.
- Collaborative Filtering
- User-to-User Similarity
- Item-to-Item Similarity
- Cosine Similarity
- Machine Learning Ranking
- Deep Learning Recommendations
- MongoDB Integration
- Redis Caching
- FastAPI Backend
- Real-Time Recommendation APIs
After completing this project, you will understand:
- HashMap Implementation
- Heap and Priority Queue Usage
- Recommendation System Design
- Ranking Algorithms
- Data Organization
- Streamlit Development
- Software Architecture
- GitHub Project Management
- Technical Documentation
- Python
- Streamlit
- Pandas
- Heapq
- Collections
- CSV
- HashMaps
- Priority Queues