In today’s competitive e-commerce market, dynamic pricing strategies are crucial for driving sales and maximizing profit. In this project I developed an automated pricing system using machine learning and data analysis techniques to modify product prices based on various factors such as competitor pricing, user traffic, product lifecycle and its sales. The system will increase prices during periods of high demand and new product releases, while reducing prices during low sales periods or as products approach the end of their market trend. It will also adjust pricing to attract price-sensitive customers by monitoring competitors’ pricing and reduce price if season offer is applied. The system is integrated into an optimized e-commerce website to update prices in real time. The project objective is to streamline pricing process and maintain competitive pricing while reducing cost and time caused by manpower.
The pricing system operates by utilizing 4 parameters as input for a Light Gradient Boosting Machine (LGBM) machine learning model to dynamically adjust the selling price of products. These parameters include
- User Traffic, which is retrieved from Google Analytics and ranges from 1 to 5, representing varying levels of user engagement and activity on the e-commerce platform.
- The Competitor Price is gathered through web scraping tools that monitor pricing on competitor platforms, in our case it is eBay, ensuring the system remains competitive in real-time.
- The Product Release Date, sourced from the pre-stored product information in MongoDB, captures how long a product has been available in the market, influencing its pricing strategy based on freshness or age.
- The Product Sales History, also stored in MongoDB, provides historical sales data that enables the model to understand trends and demand patterns.
These parameters are fed into the LGBM model, which calculates an adjustment value that is added to the product's original price to derive the selling price. The selling price is dynamic and reflects real-time market conditions, customer demand, and competitor strategies. This selling price is presented to customers on the frontend, ensuring that each product is sold at a price tailored to these influencing factors. Since the selling price can differ from the original price either increased or decreased, the system effectively personalizes the pricing for each transaction. Once a purchase is made, the relevant data, including the calculated selling price, is recorded in the Sales History section of the MongoDB database, contributing to the continuous improvement and relevance of the pricing model.
- Dataset Preprocessing:
- Aggregated features like user_traffic into discrete levels (1-5) for better interpretability.
- Removed less impactful features (product_model, season_offer).
- Engineered new features:
- Valuation Difference (difference of selling and original price).
- Competitor_Difference (price gap with competitors).
- Normalization: Applied z-score normalization to ensure consistent scaling and improve model performance.
- Model Development:
- Trained a Light Gradient Boosting Machine (LightGBM) with an MAE of 7, outperforming a Genetic Algorithm-optimized Random Forest (MAE: 11).
- LightGBM effectively captured feature interactions, leveraging the engineered data.
- Deployment: Converted the LightGBM model to ONNX format, enabling cross-platform compatibility and efficient deployment.
- Technologies: o Built with Node.js + Express.js, enabling robust and scalable REST APIs and MongoDB to utilize a NoSQL DBMS.
- API Features: o Integrated machine learning model for dynamic pricing. o REST APIs for managing products, users, orders, billing, and authentication. o Implemented entire CRUD operations using Mongoose for MongoDB.
- Concurrent Request Handling: o Deployed a Quart API (Python) to efficiently handle up to 90 concurrent REST API requests, enhancing system asynchronous operations.
- Additional Integrations: o Python Web Scraping API for extracting competitor pricing data from eBay. o Integrated Google Analytics for tracking and analyzing real-time user traffic patterns.
- Framework and Libraries: Built with ReactJS, utilizing Context API for state management and Bootstrap for responsive UI.
- Authentication: Integrated Firebase for user authentication and JWT for secure, role-based access control.
- Key Components:
- User functionalities: UI for Home, Shop, About, Contact, Orders, and Profile.
- Admin functionalities: Monitor sales data and manage product listings. Enable or disable seasonal offers with intuitive controls.
- Backend Deployment:
- Render: Deployed the Node.js + Express.js backend and Quart API application for web scraping.
- Frontend Deployment:
- Netlify: Deployed the ReactJS frontend in Netlify for ease of maintenance reliable performance.
- Live Application: Accessible at https://autopricesystem.netlify.app/.