Data Science Case Study: Optimizing Product Placement in Retail (Part 1) | by Andrew Olton | Towards Data Science

In a previous post, I wrote about an approach that I take to creating value with my data science project. To quickly recap and summarize what I said in that post, the goal of Data Science is to empower better decision making. Doing this requires that we have the empathy to ensure that we ask the right questions and that we use the right information.
When juxtaposed against the Value Proposition Canvas, data science projects can be seen as products that meet the needs of our customers (namely decision making), deal with the challenges associated to making those decisions and maximize the benefits to be gained from making the right decisions.
For today’s post, the dataset I’m going to use comes from Analytics Vidhya’s ‘Big Mart Sales III’ dataset which is available through one of their practice competitions. You can take a look using the link below.
datahack.analyticsvidhya.com
The data scientists at BigMart have collected 2013 sales data for 1559 products across 10 stores in different cities. Also, certain attributes of each product and store have been defined.
The data contained in the dataset is as follows:
Item_Identifier: Unique product ID
Item_Weight Weight of product
Item_Fat_Content: Whether the product is low fat or not
Item_Visibility: The % of total display area of all products in a store allocated to the particular product
Item_Type: The category to which the product belongs
Item_MRP: Maximum Retail Price (list price) of the product
Outlet_Identifier: Unique store ID
Outlet_Establishment_Year: The year in which store was established
Outlet_Size: The size of the store in terms of ground area covered
Outlet_Location_Type: The type of city in which the store is located
Outlet_Type: Whether the outlet is just a grocery store or some sort of supermarket
Item_Outlet_Sales: Sales of the product in the particular store.
As stated previously, in this project, we will try to find the best product placement options for maximising the Item_Outlet_Sales variable. We will do so by creating a model to forecast that value for certain items, then suggest possible ways of improving that product’s placement.
Using what we know to create our customer profile we get:
Job: Optimizing product placement
Pains: Ignorance of the factors that influence sales
Gains: Insight into customer preferences.
To create the right data product, this is what we’ll do:
Build a Model for creating sales forecastsUnderstand what affects salesBased on what affects sales, provide suggestions for increasing originals forecasts
Build a Model for creating sales forecasts
Understand what affects sales
Based on what affects sales, provide suggestions for increasing originals forecasts
I thought it would be worth sharing that I used XGBoost’s feature importance function for determining the features I’d like to manipulate in order to change the sales forecast. The graph below shows the importance of various features in the dataset:
Of all the features shown on the graph, it’s important to pay attention to the Item_MRP, Outlet_Type, Item_Visibility, Outlet_Size and Outlet_Location_Type — these are the tractable features. For this project, I’m going to assume we wish to leave the MRP as is. The most significant of which is the ‘Outlet_Type’ variable. Adjusting the forecast primarily means selecting the outlet type that will yield the most promising forecast.
In doing this, I decided that it was best to cycle through the existing outlet (and their respective configuration) due to the fact that there are only 10 BigMart outlets.
The code for doing so is as follows:
Generating our new forecast was fairly simple and was done like so:
After running the program I wrote, the following recommendation was produced:
I recommend that Item 'FDW58', be moved from Outlet 'OUT049', to Outlet 'OUT027'.The adjusted forecast is expected to be 64.0% better (2606.40), than the original forecast of $1589.31.Configuration details:Outlet_Size:  Medium --> MediumOutlet_Location_Type: Tier 1 --> Tier 3Outlet_Type: Supermarket Type1 --> Supermarket Type3Outlet_Age: 19 --> 33
Tying all of this back to what I mentioned previously about Value Proposition Design and Data Science projects, we can summarize what we have designed like so:
Products and Services: A data product which suggests the best placement options for a product.
Pain Relievers: Reduced uncertainty in decision making.
Gain Creators: Products being within reach of the customers that need them most.
Note that in this example, our solution not only solves a problem for the staff at Big Mart, but is also affects their customers. Thinking about those affected by the decisions our products support is vital to creating the right product.
It is important to note that this algorithm is commonly found in ‘perfect system’ use cases such as game-playing and simulation in which all the rules of the system are known and there are no unknown variables. Unfortunately, this is not how life works. Machine Learning techniques applied to “what if” scenarios serve only to provide a guide on what may yield the best results.
Even though were provided with sales data, were are still not sure of the seasonality of the shopping habits observed, which can certainly have an impact on the quality of the recommendation produced. A better version of this system would be able to find the best placement options for multiple products while allowing users to prioritize one product over another.
I hope that this post gave you a clear and practical approach to using creating value with your Data Science to projects and I hope that you learned something new. As usual I welcome your feedback and look forward to producing more content.
I would like to end this post by giving a shout to some very important people. Firstly I would like to thank the lovely folks at Data Helpers for making themselves available for questions, guidance and data science help in general. If you are looking for a Data Science mentor, I highly recommend that you start there. I would also like to thank Rachael Tatman for putting me on to them and also for the excellent work she’s doing at Kaggle in Data Science education.
If you would like to learn more about the tools I used to build the solution mentioned in this case study, please see the links below: