Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bCBA

Classification Based on Association Rules


Description

Build a classifier using a transaction boosting classification by association algorithm. The algorithm is currently in development, and is not yet formally documented.

Usage

bCBA(formula, data, gamma = 0.05, cost = 10.0,
     parameter = NULL, control = NULL, sort.parameter = NULL, lhs.support = FALSE,
     class.weights = NULL, disc.method = "mdlp", verbose = FALSE, ...)

Arguments

formula

A symbolic description of the model to be fitted. Has to be of form class ~ .. The class is the variable name (part of the item label before =).

data

A data.frame containing the training data.

gamma, cost

Hyperparameters for the bCBA algorithm.

verbose

Optional logical flag to allow verbose execution, where additional intermediary execution information is printed at runtime.

parameter, control

Optional parameter and control lists for apriori.

sort.parameter

Ordered vector of arules interest measures (as characters) which are used to sort rules in preprocessing.

lhs.support

Logical variable, which, when set to default value of True, indicates that LHS support should be used for rule mining.

class.weights

Weights that should be assigned to the rows of each class (ordered by appearance in levels(classColumn))

disc.method

Discretization method for factorizing numeric input (default: "mdlp"). See discretizeDF.supervised for more supervised discretization methods.

...

Additional parameters are added to the apriori parameters (e.g., support and confidence).

Details

Formats the input data frame and calls a C implementation of a transaction-boosted classification algorithm which is currently being developed. This R package provides an interface to the current most stable release

Before the 'bCBA' algorithm in C is executed, association rules are generated with the Apriori algorithm from the arules package.

A default class is selected for the classifier. Note that for datasets which do not yield any strong association rules it's possible that no rules will be included in the classifier, and only a default class.

Value

Returns an object of class CBA representing the trained classifier with fields:

rules

the classifier rule base.

default

default class label.

levels

levels of the class variable.

Author(s)

Ian Johnson

See Also

Examples

data("iris")

classifier <- bCBA(Species ~ ., data = iris, supp = 0.05, conf = 0.9,
		   lhs.support = TRUE)
classifier

predict(classifier, head(iris))

arulesCBA

Classification Based on Association Rules

v1.2.0
GPL-3
Authors
Michael Hahsler [aut, cre, cph], Ian Johnson [aut, cph], Tyler Giallanza [ctb]
Initial release
2020-4-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.