Learn R Programming

arulesCBA (version 1.1.6)

mineCARs: Mine Class Association Rules

Description

Class Association Rules (CARs) are association rules that have only items with class values in the RHS (Liu, et al., 1998).

Usage

mineCARs(formula, data, balanceSupport = FALSE, parameter = NULL, control = NULL, ...)

Arguments

formula

A symbolic description of the model to be fitted.

data

An object of class transactions containing the training data.

balanceSupport

logical; if TRUE, class imbalance is counteracted by using the minimum support specified in parameter only for the majority class. The minimum support for the minority classes is reduced proportional to the class imbalance (i.e., the support of the item representing the class label).

parameter, control

Optional parameter and control lists for the apriori algorithm.

...

For convenience, additional parameters are used to create the parameter control list for apriori (e.g., to specify the support and confidence thresholds).

Value

Returns an object of class rules.

References

Liu, B. Hsu, W. and Ma, Y (1998). Integrating Classification and Association Rule Mining. KDD'98 Proceedings of the Fourth International Conference on Knowledge Discovery and Data Mining, New York, 27-31 August. AAAI. pp. 80-86.

See Also

apriori, rules, transactions.

Examples

Run this code
# NOT RUN {
data("iris")

iris.disc <- discretizeDF.supervised(Species ~ ., iris)
iris.trans <- as(iris.disc, "transactions")

# mine CARs with items for "Species" in the RHS
cars <- mineCARs(Species ~ ., iris.trans, parameter = list(support = 0.3, confidence = 0.9))
inspect(cars)

# for conveiniance this can also be written without parameter and the list
cars <- mineCARs(Species ~ ., iris.trans, support = 0.3, confidence = 0.9)

# restrict the predictors to items starting with "Sepal"
cars <- mineCARs(Species ~ Sepal, iris.trans, support = 0.1, confidence = 0.9)
inspect(cars)
# }

Run the code above in your browser using DataLab