Market Basket (1).png

This project is about conducting Market Basket Analysis on a Bakery in Edinburgh. Market Basket Analysis is a technique that is commonly done by a Data Scientist to see correlations between items bought by a customer. This analysis is useful to know what item is commonly bought together, so that it can provide insights to stakeholders such as the Baker Owner to produce more on what items, what needs to be put together, or even make a package with special price (e.g., customers often buy bread with a glass of coffee, so the owner makes a “Paket Spesial” with special price).

This project was first started when I came up with an idea of supporting food sustainability. Because if a business owner (in this case Bakery) doesn’t decide the right number of items to produce, food will be wasted and also brings loss to their business. For example, bread and coffee are commonly bought together frequently, and another item like cookies are less frequent, so the Bakery Owner should produce more on bread and coffee, and should not stock too much cookies.

As a Data Scientist who is helping a Bakery to provide insights through Market Basket Analysis, I started by doing Exploratory Data Analysis, where I have to explore this dataset, calculate statistic properties, and visualizing data to gain initial insight before exploring further. I also fix any missing and invalid values in the dataset. Then I develop a Machine Learning model called the Apriori Algorithm which suits good for this problem, where this algorithm associates relevant items such as “coffee with bread” and “cake with tea” that share similar values, indicating that they were bought together by customers.

This is one of my favorite projects in Data Science where I had the chance to implement my knowledge on a real-life problem to help reduce food wastes and bring profit to business owners. I also resolved the challenges I had by conducting further exploratory and visualization to gain more insights regarding the data.

Screenshots

This Chord Diagram helps telling us that tendency of an item being bought after buying another item (e.g., Customer who buys coffee also likely to buy cake)

This Chord Diagram helps telling us that tendency of an item being bought after buying another item (e.g., Customer who buys coffee also likely to buy cake)

Some code snippet with Python’s Matplotlib to visualize the items that were bought in 4 different time (Morning, Afternoon, Evening, and Night)

Some code snippet with Python’s Matplotlib to visualize the items that were bought in 4 different time (Morning, Afternoon, Evening, and Night)

The final result of this analysis was brought to making a simple Web Application with Python’s Streamlit

The final result of this analysis was brought to making a simple Web Application with Python’s Streamlit