Data Mining Algorithms In R/Packages/RWeka/Weka associators

From Wikibooks, open books for an open world
Jump to: navigation, search

Description[edit]

R interfaces to Weka association rule learning algorithms.

Usage[edit]

Apriori(x, control = NULL)

Tertius(x, control = NULL)

Arguments[edit]

x, an R object with the data to be associated.

control, an object of class Weka_control, or a character vector of control options, or NULL (default).

Details[edit]

Apriori implements an Apriori-type algorithm, which iteratively reduces the minimum support until it finds the required number of rules with the given minimum confidence.

Tertius implements a Tertius-type algorithm, requires Weka package tertius.

Value[edit]

A list inheriting from class Weka_associators with components including:

associator, a reference (of class jobjRef) to a Java object obtained by applying the Weka build Associations method to the training instances using the given control options.

Example[edit]

   x <- read.arff(system.file("arff", "contact-lenses.arff",package = "RWeka"))
   Apriori(x)
   Apriori(x, Weka_control(N = 20))
   Tertius(x)
   Tertius(x, Weka_control(S = TRUE))