Skip to content

srsimsima81-cloud/E-Commerce-Product-Recommendation-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 E-Commerce Product Recommendation Engine

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.

📌 Project Overview

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.

🎯 Objective

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

🏢 Industry Relevance

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

🧠 DSA Concepts Used

  • Arrays / Lists
  • HashMaps / Dictionaries
  • Sets
  • Sorting Algorithms
  • Heap / Priority Queue
  • Similarity Scoring
  • Searching
  • Ranking Algorithms

⚙️ Workflow

User Activity → Purchase History → Search History → Cart Activity → Similarity Scoring → Ranking Engine → Priority Queue → Top-N Recommendations

🏗️ Architecture

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

📂 Project Structure

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

📊 Dataset

Products Dataset

Contains:

  • Product ID
  • Product Name
  • Category
  • Rating

User Dataset

Contains:

  • User ID
  • Purchase History
  • Search History
  • Cart Activity

🔍 Recommendation Logic

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.

🧮 Algorithm

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.

⏱ Time Complexity

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

✨ Features

  • 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

🖥️ User Interface

Features:

  • Neon Cyberpunk Theme
  • Interactive Sidebar
  • Product Tables
  • Recommendation Dashboard
  • Similar Product Explorer
  • Category Ranking Viewer

📦 Installation

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

▶️ Run Project

streamlit run app.py

📈 Sample Output

Recommended Products

  1. Sony Headphones
  2. MacBook Air
  3. Dell XPS
  4. Apple Watch
  5. Samsung S24

Category Recommendations

Electronics

  • Sony Headphones
  • Apple Watch
  • Noise Smartwatch

Similar Products

iPhone 15

  • Samsung S24
  • OnePlus 12

📄 Documentation

architecture.md

System architecture and workflow.

algorithm.md

Recommendation algorithm explanation.

project_report.md

Complete project report.

future_enhancements.md

Future project improvements.

🚀 Future Enhancements

  • 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

🎓 Learning Outcomes

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

🛠️ Technologies Used

  • Python
  • Streamlit
  • Pandas
  • Heapq
  • Collections
  • CSV
  • HashMaps
  • Priority Queues

About

AI-powered E-Commerce Product Recommendation Engine built using Python and Streamlit. Implements HashMaps, Heap, Sorting, and similarity-based ranking to generate personalized product recommendations with a futuristic neon UI dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages