LoslegenKostenlos loslegen

Picking the right movie parameters

You are still wondering how to decide which parameters to add in the apriori() function. In particular, you need to decide the thresholds to use for the minimum support, confidence or eventually lift measures. The parameters added to the apriori() function will have an impact on the set of movie rules we obtain. To help in deciding which parameters are most appropriate to obtain the set of movie rules, let's create a plot of the number of rules. In this exercise, you will create a plot to decide on the most appropriate combination of parameters to be used in the apriori() function.

Diese Übung ist Teil des Kurses

Market Basket Analysis in R

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Set of confidence levels
confidenceLevels = seq(from=0.95, to=0.5, by=-0.05)

# Create empty vector
rules_sup04 = NULL

# Apriori algorithm with a support level of 40%
for (i in 1:length(___)) {
  rules_sup04[i] = 
  ___(apriori(movie_trx,
                 parameter=list(sup=___, 
                                conf=confidenceLevels[i],
                                target="___")))
}
Code bearbeiten und ausführen