cover

Anand Ranganathan

MLMLOpsRetail

Maximizing margins through Machine Learning : A Retail Case Study on Price Optimization

Author
Anand Ranganathan
Cover
RetailForecasting.webp
Slug
price-optimization
Person
Published
Published
Date
Jun 10, 2024
Category
ML
MLOps
Retail

CHALLENGE

Our customer, a retail giant in Thailand, stands as the foremost home improvement retailer in the country, boasting a network of over 140 stores nationwide. Their diverse product range spans more than 120,000 SKUs, covering everything from building materials and tools to furniture, appliances, and décor.
HomePro faced a challenge around price optimization. With a multitude of SKUs sold through stores and online channels, there was a need to understand drivers of price that would keep HomePro competitive as well as maximize gross margin and profit.
  • HomePro did not have access to an integrated single view of the data on a common platform where price simulations could be performed efficiently
  • HomePro did not have any automated mechanisms or tools that merchandisers could use to decide on optimal prices in a data-driven manner. The team had to create custom data pulls for each category and the entire planning process used to be done on spreadsheets. Pricing and demand planning used to take 2-3 weeks’ effort per cycle
  • Inventory planning, promotion planning and pricing was not standardized across merchandising categories and channels. Each buyer used to plan for their own categories using their own heuristics resulting in overstocking and locking up working capital
Hence, there was a need to develop a capability where
  • All relevant historical and current datasets could be collected in a single platform which can be used as a single source of truth for every major use case
  • Leverage state of the art AI algorithms on top of these datasets to empower business teams to take data driven pricing and inventory planning decisions in a matter of hours
  • Standardize promotion planning(selecting articles for the promotion and furthermore, determining the optimal prices of those articles during the promotion days), pricing and demand planning for all categories freeing up working capital

SOLUTION:

As part of the project led by AWS ProServe, a data lake was created on AWS where data from multiple sources was ingested. This included historical transaction (purchase) data, promotion data, inventory data, etc. The OneByZero team came in to develop, test and deploy a machine-learning based system to optimize prices. This included :
  1. Creating a demand forecasting model that took into account a variety of features like price, discount, holidays, weekday/weekends, etc.
  1. Developing a pricing calculator and article suggestion algorithm to recommend the optimal set of articles for a given future promotion period and the associated optimal prices of these articles
  1. Developing a price simulation model for users to understand and analyze the effect of price on the forecasted demand and revenue.
Based on a workshop conducted with the HomePro team, two product lines : Bathroom (BR) and Floor & Ceramics (FC) were identified as the initial ones to build the price optimization framework. We adopted the state-of-the-art DeepAR forecasting algorithm, integrated with SageMaker on AWS to develop a dynamic demand forecasting model capable of predicting sales demand based on various factors/variables (internal & external).
Business Users: The primary business users of the price optimization model were the buyers. Retail buyers are instrumental to a Retail company's success as they are responsible for strategically curating product assortments, managing inventory, setting pricing strategies, and optimizing sales. Their decisions directly impact revenue generation, making them vital contributors to the company's overall profitability.

Implementation

Data Collection, Cleaning & Model Training

Our ML team undertook several activities as part of the implementation of the demand forecasting model. This included data preparation, feature engineering, and model training using SageMaker's DeepAR. Several steps were taken to optimize the accuracy of the predictions, including :
  1. Generation of additional features to reflect lagged impact of seasonal events and holidays
  1. Experimentation with different normalization techniques
  1. Special handling of outliers to avoid skewing the model
  1. Special handling of sparsity in the data (where certain articles may have 0 sales on several days)
  1. Addition of categorical features to reflect the category and other properties of the algorithm
  1. Careful tuning of the accuracy definition and loss function
  1. Experimentation with different hyperparameters
The goal of the model training exercise was to achieve a certain accuracy threshold on predictions of the demand given the input features up to 90 days in the future. More specifically, the goal was to achieve this accuracy threshold on a significant percentage of the top revenue generating articles on selected backtesting periods. Even though the forecast horizon was quite long (90 days), and the data had lots of issues around outliers and sparsity, the ML team was able to achieve the desired accuracy level after a few weeks of tuning of the model.
We productionized the model leveraging Amazon Sagemaker. For real time inference, we created a real time endpoint using Sagemaker and for generating multiple predictions, we used Sagemaker batch processing job. To ensure that the model is constantly learning, we created a feedback loop in which we monitor input data(for data quality and data drift), retrain the model with new data and perform backtesting to ensure that models used in production are accurate.

Use cases:

Following the model training, we developed two use cases to assist the buyers with SKU selection & price optimisation.
  • SKU suggestion : In this scenario, the buyer utilizes a simple UI to input parameters such as “vendor name”, “brand”, “product category”, “promotion period”, and “expected revenue” (soft constraint). The model then generates a set of suggested SKUs based on these inputs, presenting the buyer with a list of top performing SKUs at four different price points, along with estimated quantities, expected sales, and expected profit. Armed with this data, the buyer can pick a set of SKUs for a future promotion period that aligns with business priorities and optimizes sales. This use case relies on batch predictions, done using up to 10 different price points, out of which the top 4 based on revenue are selected and presented to the user.
  • Price simulation: This use case comes into play, when the buyer focuses on a single SKU. The buyer provides input data points such as, "SKU code," "Promotion Period," and "Discount." The model employs both the given input and available features of the SKU for the forecast horizon to predict the demand (expected quantities), expected sales and expected profit for the SKU at the specified price. The buyer can analyze demand at various price points, allowing them to pick the optimal price to achieve sales and profit goals.

AWS services in the solution

The Machine Learning team made use of various AWS tools & services as shown below:
  1. AWS SageMaker (various services offered by sagemaker for data preparation, training, deployment, batch inference and real-time inference)
  1. S3 storage
  1. AWS Codecommit
  1. AWS Cloudwatch
  1. AWS Athena
High level architecture
notion image

RESULTS AND BENEFITS

Key Outcomes

The demand forecasting model was tuned to achieve the desired accuracy level. Overall, it achieved an overall accuracy of 84% on the two identified initial product lines (BR and FC). Furthermore, it was able to show at least 70% accuracy on a significant percentage of the top revenue generating articles. The AI model improved the accuracy by 40-50% as compared to the manual forecasting exercise.
With this performance, the team got the go-ahead to deploy this model live. The model was deployed, and the HomePro team was given the required knowledge transfer to allow them to manage the model and make it available to business users through the UI for the two use-cases described earlier.
Furthermore, the prices recommended by the model for a test promotion period showed a 3% sales uplift, a 19% gross-profit uplift and 5% gross margin uplift compared to the baseline, manually set prices. The time needed for inventory planning and price optimization reduced from 2-3 weeks to a few hours.

Success Factors

A phased implementation approach along with collaboration between data scientists and business stakeholders, allowed for continuous feedback and refinement of the solution that led to its success. Furthermore, the capabilities provided by Sagemaker for running experiments, keeping track of model performance metrics and deploying the model for batch and real-time inference helped speed-up the delivery of the project.

WE ARE ONEBYZERO

Headquartered in Singapore with local presence in Asean nations, we are a modern data & AI consulting firm. We focus on transforming enterprises with cutting edge solutions to generate value from data. We specialize in serving the Telecommunications, Banking & Financial Services, Retail and Ecommerce industries.

We focus exclusively on AI/ML, Data & Martech

AI & ML, including Generative AI

We help organizations define their AI/ML strategy, develop and operationalize AI/ML & generative AI models, and implement MLOps to streamline operations. We have experience doing a variety of work in classical data science and cutting edge GenAI for Telcos

Modern Data Platforms

Our team of experts build robust data pipelines, design data warehouses and lakes with strong focus on data quality and lineage, to build C360, marts, support reporting, dashboards to help organizations uncover insights in their data using a modern data stack.

Martech & Personalization

We enable customers to modernize their digital platforms to deliver omni channel personalization use-cases. We have deep experience with marketing use-cases & personalized content generation, automated campaign grid optimization and next-best offers & actions.

Related Posts