top of page

Market Basket Analysis For BigBasket Grocer

Case "Customer Analytics at Bigbasket - Product Recommendations". Pramod Jajoo, the Chief Technology Officer, at Bigbasket identified two customer pain points while placing orders for products at Bigbasket. What product recommendation algorithm would solve these two pain points?

Case "Customer Analytics at Bigbasket - Product Recommendations". Pramod Jajoo, the Chief Technology Officer, at Bigbasket identified two customer pain points while placing orders for products at Bigbasket. Since many customers were placing orders using their mobile handsets, it was taking more time to scroll through the products since customers may place order for more than 50 items in a single transaction. Another problem with repeat purchases is that many customers tend to forget items they need, which may lead to additional orders from customers. To address these two issues Bigbasket wanted to build a product recommendation algorithm that would look at historical data to create a "Smart Basket" with items that customer is likely to purchase.


Executive Summary 

Customers of popular Indian online grocer BigBasket are experiencing pain points in their shopping experience, including significant scrolling time on large orders when using mobile devices, as well as a tendency to place multiple orders when items in their first order are forgotten. A set of recommendation system rules were discovered in order for BigBasket to implement into a recommender engine to improve customer experience. Customers have a very strong interest in vegetable items and affiliated food groups that are consumed with vegetables such as daal or rice, and we advise that the recommendation system factor these in, alongside the ability for customer to personalize their recommendations in a “Smart Basket” offering, which should also include a “Did You Forget?” feature.


Background & Problem Definition

BigBasket, a popular Indian online grocer that carries various food items and household goods, is experiencing customer pain points. Chief Technology Officer Pramod Jajoo said that since many customers place orders using mobile phones, it takes them significant time to scroll through their product selections, especially if selecting more than 50 items in a given transaction. Additionally, customers tend to forget what items they need during repeat purchase, a dynamic that can cause inconveniences because customers may have to place additional orders.


To address these issues, BigBasket seeks to build a “Smart Basket” recommender algorithm that takes historical purchase data and crafts recommendations for customers on what items they are most likely to purchase. A data set of 100 customers’ purchase behavior was provided for this analysis. Each observation in the data frame consists of variables from a single instance of a customer order. That includes the customer ID number, order number, the stock keeping unit (SKU) inventory number and a small description of the item purchase. (e.g. cashews). All analysis is performed in R.


Methods & Diagnostics

Preprocessing

The data frame was converted into a transactionary format in order to use association rule mining techniques in R. The transaction matrix takes every instance of every store item purchased in the provided data frame and counts the frequency of those products on an itemized basis, where an instance of a purchase = 1 and an instance of no purchase = 0.


Next, the R apriori function (named after the classic algorithm used for association rule mining) is used to take the transaction dataset as an input, where each transaction consists of a set of items. It then identifies frequently occurring itemsets based on a user-given minimum support threshold. A minimum threshold of support at 0.015 and confidence at 0.73 are used. Support refers to the proportion of transactions in the dataset that contain a particular set of items, while confidence measures the conditional probability of finding a consequent item given the occurrence of an antecedent item a given association rule. The apriori function was then used for rule generation. Those rules are visualized in the following parts of this analysis. 


BigBasket Recommender System vs. Other E-Commerce Platforms

BigBasket’s recommendation system operates at a transaction level, focusing on Market Basket Analysis (MBA). This approach identifies associations between products based on their co-occurrence in transactions. On the flipside, Amazon and Spotify primarily operate their recommendation systems at a user level, focusing on individual user behavior over time. These systems often utilize techniques to predict a user’s interests by collecting preferences from many users, and content-based filtering, which recommends items by comparing the content of the items and a user’s profile. We acknowledge that the scale of this BigBasket analysis with 100 customers is significantly smaller compared to a recommender system used by major retailers and other platforms like Amazon and Spotify. This analysis is a small association rule exercise, however larger platforms are very likely using recommendation engine techniques that consider content-based recommendations, individual user profiles, collaborative filtering (thanks in part due to the large user bases that Spotify and Amazon have), and other machine learning techniques to capture user behavior patterns among item features.


Top 10 Items at BigBasket

The top 10 items customers are purchasing at BigBasket include the following:


Insights Drawn:

  • Other Vegetables, Beans, and Root Vegetables are the top three most purchased items, indicating a high demand for fresh produce.

  • Other Dals and Organic F&V (Fruits and Vegetables) are also popular choices, showcasing customer preference for organic food.

  • Gourd & Cucumber and Brinjals suggest a preference for specific types of vegetables among customers.

  • Namkeen is among the top 10 items, indicating a significant demand for snacks.


Market Basket Analysis – Rules & Smart Basket 

Upon analyzing the basket of customer purchases, we drew insights for top 10 rules BigBasket may consider implementing into their recommendation system (see Figure 1 of the Appendix).


Major insights are below:

  • There is a strong association between combinations of dal types such as Moong Dal, Toor Dal, Urad Dal, and Whole Spices with the purchase of Other Dals, which indicates that customers who buy these combinations are also likely to purchase other types of dals.

  • Combinations involving Boiled Rice, Other Vegetables, Root Vegetables, and Beans suggest that customers who buy Boiled Rice along with these specific vegetables are also likely to purchase Beans.

  • The presence of Gourd & Cucumber, Root Vegetables, and Toor Dal in combinations indicates a high likelihood of customers also purchasing Other Vegetables.

  • The combination of Brinjals, Exotic Vegetables, Other Vegetables, and Root Vegetables suggests a strong association with the purchase of Beans.


From the provided rules, two interesting, unexpected rules include:

{Beans, Gourd & Cucumber, Root Vegetables, Toor Dal} => {Other Vegetables}

  • Suggests that when customers purchase beans, gourd & cucumber, root vegetables, and toor dal together, there is a high likelihood (confidence of 0.855) they will also purchase other vegetables. It may suggest that, at least from this data sample, the customer base comprises heavily of vegetarians or those with dietary restrictions that construe them to eating vegetables often. 

{Boiled Rice, Brinjals} => {Beans}: 

  • Suggests a combination of items that might be used together in a meal. This could be used to recommend “Beans” to customers who are buying “Boiled Rice” and “Brinjals”, potentially helping them complete their meal. A recommendation for a customer having “Boiled Rice and Brinjals” in their basket would not only be to suggest beans but to also possibly recommend other vegetables and root vegetables. See Figure 2 of Appendix.


Please note a visualization of the rules can be found in Figure 3 of the Appendix.

A Smart Basket feature can utilize the provided association rules to generate personalized recommendations for customers by recommending related or complementary products based on selections. For instance, if a customer has beans, gourd & cucumber, root vegetables, and toor dal in their basket, a Smart Basket can suggest other vegetables that are commonly purchased together with these items.

BigBasket may consider including a section displaying the top association rules relevant to the customer’s purchase history, which can aid in helping customers understand the reasoning behind the recommendations. Customers can consider having an option to customize their basket preferences by selecting specific items they find most relevant or frequently purchase.


A “Did You Forget?” may also leverage the association rules to detect potential missed items based on the customer’s basket contents. For instance, if a customer has gourd & cucumber, root vegetables, and toor dal in their basket, the system can remind them to consider adding other vegetables based on the association rules.


Challenges & Recommendations for Implementation 

Implementing a “Smart Basket” and “Did you Forget?” feature presents challenges. The quality and quantity of transaction data directly impact the accuracy of recommendations. Additionally, customer preferences can change over time, necessitating regular updates to the association rules. 


To address these, it’s crucial to ensure robust data collection and preprocessing, secure handling of customer data, and regular updates to the system. The user experience should be considered, presenting recommendations in a non-intrusive way and allowing customers to opt-out of the recommender system at any time. 


BigBasket should also consider how it labels its data, as the frequencies of itemsets that were unpacked in this analysis do not factor in brand names or alternate offerings of a similar product (e.g. green beans vs. black beans), and there may be additional insights that can be discovered through knowing product or brand preferences. 


Appendix

Figure 1 - Table rank of top 10 rule associations


RankRuleSupportConfidenceCoverage1{Moong Dal, Toor Dal, Urad Dal} => {Other Dals}0.0180.8130.0222{Moong Dal, Toor Dal, Whole Spices} => {Other Dals}0.0190.7750.0243{Moong Dal, Urad Dal, Whole Spices} => {Other Dals}0.0150.7700.0204{Moong Dal, Other Vegetables, Toor Dal} => {Other Dals}0.0180.7390.0245{Boiled Rice, Other Vegetables, Root Vegetables} => {Beans}0.0160.8090.0196{Beans, Gourd & Cucumber, Root Vegetables, Toor Dal} => {Other Vegetables}0.0170.8550.0207{Boiled Rice, Brinjals} => {Beans}0.0160.7950.0208{Beans, Brinjals, Gourd & Cucumber, Toor Dal} => {Other Vegetables}0.0150.8520.0189{Gourd & Cucumber, Root Vegetables, Toor Dal} => {Other Vegetables}0.0230.8380.02710{Brinjals, Exotic Vegetables, Other Vegetables, Root Vegetables} => {Beans}0.0160.7800.020


Figure 2 - Recommended Product 






Figure 3 - Rules Visual Diagram

















Project Gallery

bottom of page