A Tutorial About Market Basket Analysis in Python

A gentle introduction of Market Basket Analysis and its Applications

George Pipis
The Startup

--

Photo by Phuong Tran on Unsplash

What is Market Basket Analysis

Intuitively, we could say that the Market Basket Analysis is given a database of customer transactions, where each transaction is a set of items, the goal is to find a group of items that are frequently purchased. The outcome of the algorithm will be a recommendation like that if you buy one or more specific items then you are more (or less) likely to buy this extra item. So, for example, if someone has already added to his basket cereals then it is more likely to add milk. Practically, in Market Basket Analysis we are not looking for similar products, but for supplementary products. For the algorithm, we need to identify products that tend to be purchased together.

The Market Basket Analysis can be applied in the following cases:

  • Build a movie/song recommendation engine
  • Build a live recommendation algorithm on an e-commerce store

--

--

George Pipis
The Startup

Sr. Director, Data Scientist @ Persado | Co-founder of the Data Science blog: https://predictivehacks.com/