From this article, you will learn how we built an algorithm to select the optimal prices for the e-commerce company. Pricing is an essential part of e-commerce, here we’re presenting a case study about price optimization project for one of our clients.
Price optimization is the process to determine how the client’s behavior will change when the price changes. There are a lot of articles describing how to set appropriate prices from economic, managemental, and sociological points of view. Here we are describing how we approached this task from the machine learning and statistics perspective.
Determining how customers will respond to different prices is a crucial part of any business. It helps to answer such questions as:
- Which price is so high that your clients will be forced to go to your competitors?
- Which price is so low that it will decrease the perceived value of your product?
- How to find the optimum where your clients are satisfied, and the company makes money?
- How often to change prices?
- Did your price decrease noticeably?
All these questions can be addressed during the price optimization workflow and can be resolved all at once.
For one of our clients, we created a tailored algorithm specifically for their needs. The scope of the project was divided into three sections: building the algorithm, testing it in real-time and drawing the conclusions.
Building price optimization algorithm our ultimate goals were:
- Create an algorithm from scratch adjusted to the client’s needs
- Simple to maintain and develop in the future
- Fast to implement
We started from the extensive exploratory analysis to understand the patterns in data, discover inconsistencies to address in the early stages and to investigate presented trends.
During this stage, we found the weekly demand cycle for many products and changed prices once a week to see the effect of price change. We also identified products, that had almost no price changes; which was a critical point for us, because we had to use another approach to properly price them.
We worked with two main concepts: price elasticity and market basket penetration.
Price elasticity is the responsiveness of the quantity demanded of a good or service to a change in its price when nothing but the price changes.
%△in Qd – Percentage Change in Quantity
%△in P – Percentage Change in Price
Change in demand can be approached in two ways:
- As a change in the quantity of the product that someone buys, e.g., due to the decreased price same clients started to buy more units of the same product.
- As a change in market basket penetration for a product, e.g., old and new clients started to buy this product after the price changed. In this definition, a new client is someone who purchased other products from a particular category but not the product we are interested in.
When considering the first approach, some complications may arise.
Imagine that you usually buy 5L of water every two weeks. What will you do if one day you see that the price dropped by 50% on the water you buy? Probably, you will buy 20L and forget about this product for the next two months.
This kind of reasoning brought us to the realization that market basket penetration better suits our needs. Knowing the price elasticity of the products, we could change the price of more sensitive ones and expect an increase in sales, or increase the price of less sensitive and sell those products at the same sales rate.
We were eager to investigate the relationship between a price change and market basket penetration for each product, and for this purpose, we used the Bayesian approach.
Bayesian statistics interprets probability as a reasonable expectation based on prior knowledge. It has a few key benefits, comparing to the standard frequentist approach:
- We get a distribution of likely estimations instead of only one “true” estimation, which informs us about the confidence our model has (wider distributions are less certain).
- We can introduce expert knowledge to the model, e.g. by defining a proper distribution knowing that the price elasticity is mostly negative.
- We can use a hierarchical Bayesian model, that allows us to do predictions for products with less empirical data, using general characteristics of the product category.
Going deeper into the advantages of the hierarchical Bayesian model, it is worth to mention its ability to combine several levels of one task. In our case, we wanted to estimate price elasticity and there were at least two possible levels: the product level and the category level. This allowed us to use the mean of the category in cases where we had a small data set of price changes for specific products. This phenomenon where the estimations for the product are influenced by the group is called shrinkage and it was a life-saver for the products with almost no price change history.
By the end of the first phase, we had the algorithm that was estimating how sensitive our products were and defining the appropriate price. During the testing phase of our project, we saw a significant increase in sales rate as well as margin in some categories caused by the decisions of our algorithm. It was a huge achievement for our team!
By the way, we did a talk on Data Science Summit about the Bayesian approach in e-commerce, covering hierarchical models as well as price-demand change analysis. If you what to dive into more tech details, follow this link.
This system can be used as a parameter in the reinforcement learning model when it weekly chooses the best prices based on all the different factors: weather, time of the year, sales rate before, price elasticity and product description. It can be a very efficient and effective tool in any e-commerce business.
Interested in doing such an analysis for your business? We are here to help!
Contact me to get answers to your questions: email@example.com