CommencerCommencer gratuitement

Changing the appearance of rules

It may happen that you do not want to calculate the confidence and lift measures for all rules, but rather some specific rules or some specific items. Adding constraints such as specifying items on the left and right hand side of the rules is of primary interest, especially if the number of items is very large. In this exercise, you will calculate the confidence and lift of rules containing the specific item HERB MARKER ROSEMARY. However, this item can either be on the left hand side of the rule or the right hand side of it.

The transactional object Online_trx is loaded in the workspace.

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.

# Find the confidence and lift measures
rules_rosemary_rhs = 
	apriori(Online_trx,
            parameter = list(supp=0.01, conf=0.5, minlen=2),
            appearance = list(___="___",
                              default = "___")
)

# Inspect the rules
___(___)
Modifier et exécuter le code