ComeçarComece de graça

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.

Este exercício faz parte do curso

Market Basket Analysis in R

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# 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
___(___)
Editar e executar o código