Frequent itemset generation
We will now look at a better technique to find patterns and detect frequently bought products. For this, we will be using the frequent itemset generation technique. We will be implementing this algorithm from scratch because, even though when we solve any machine learning or optimization problem we usually use readymade machine learning algorithms out of the box which are optimized and available in various R packages, one of the main objectives of this book is to make sure we understand what exactly goes on behind the scenes of a machine learning algorithm. Thus, we will see how we can build some of these algorithms ourselves using the principles of mathematics, statistics, and logic.
Getting started
The data we will be using for this is the shopping_transaction_log.csv
dataset which we used to explain the concepts of market basket analysis at the beginning of the chapter. The code we will be using for this section is available in the ch3_frequent
itemset generation...