Get startedGet started for free

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.

This exercise is part of the course

Market Basket Analysis in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample 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
___(___)
Edit and Run Code