Multiple baskets
When performing market basket analysis in real life, you're likely going to face hundreds if not thousands of baskets and item combinations. The Online_Retail_clean
dataset which is available in your workspace, contains the cleaned version with no missing data of the Online_Retail_2011_Q1
dataset. You will use this dataset to start working on a large number of baskets and figure out the average number of both total and distinct items in each basket. You will as well visualize the distributions of the number of items in the different baskets.
This exercise is part of the course
Market Basket Analysis in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create dataset with basket counts and inspect results
basket_size = Online_Retail_clean %>%
group_by(___) %>%
___(n_total = ___,
n_items = n_distinct(___))
___(___)