Session Ready
Exercise

Pruning with scatterplots

After viewing your Batman-based streaming service proposal from the previous exercise, the founder realizes that her initial plan may have been too narrow. Rather than focusing on initial titles, she asks you to focus on general patterns in the association rules and then perform pruning accordingly. Your goal should be to identify a large set of strong associations.

Fortunately, you've just learned how to generate scatterplots. You decide to start by plotting support and confidence, since all optimal rules according to many common metrics are located on the confidence-supply border. The one-hot encoded data has been imported for you and is available as onehot. Additionally, apriori() and association_rules() have been imported and pandas is available as pd.

Instructions
100 XP
  • Generate a large number of itemsets with 2 items by setting the minimum support to 0.0075 and setting the maximum length to 2.
  • Complete the statement for association_rules() in a way that avoids additional filtering.
  • Complete the statement to generate the scatterplot, setting the y variable to use confidence.