CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Market Basket Analysis in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create dataset with basket counts and inspect results
basket_size = Online_Retail_clean %>%
  group_by(___) %>%
  ___(n_total = ___,
      n_items = n_distinct(___))

___(___)
Modifier et exécuter le code