Learn R Programming

arulesCBA (version 1.1.6)

RCAR: Regularized Class Association Rules (RCAR)

Description

Build a classifier based on association rules mined for an input dataset and weighted with LASSO regularized logistic regression (Azmi, et al., 2019).

Usage

RCAR(formula, data, support = 0.1, confidence = 0.8, lambda = NULL, alpha = 1,
    balanceSupport = FALSE, disc.method = "mdlp",
    parameter = NULL, control = NULL, ...)

Arguments

formula

A symbolic description of the model to be fitted. Has to be of form class ~ . or class ~ predictor1 + predictor2.

data

A data.frame containing the training data.

support, confidence

Minimum support and confidence for creating association rules.

lambda

The amount of weight given to regularization during the logistic regression learning process. If not specified (NULL) then cross-validation with the argest value of lambda such that error is within 1 standard error of the minimum is used (see cv.glmnet).

alpha

The elasticnet mixing parameter. alpha = 1 is the lasso penalty (default RCAR), and alpha = 0 the ridge penalty.

balanceSupport

balanceSupport parameter passed to mineCARs function.

disc.method

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

parameter, control

Optional parameter and control lists for apriori.

...

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 CBA representing the trained classifier with the additional fields:

all_rules

all rules used to build the classifier, including the rules with a weight of zero.

reg_model

them multinomial logistic regression model as an object of class codeglmnet.

Details

Uses logistic regression to assign rule weights to class assocation rules. The logistic regression is regularized with LASSO regularization, encouraging sparsity in rule weights.

References

M. Azmi, G.C. Runger, and A. Berrado (2019). Interpretable regularized class association rules algorithm for classification in a categorical data space. Information Sciences, Volume 483, May 2019. Pages 313-331.

Original code at https://github.com/azemi/RCAR.

See Also

glmnet and cv.glmnet.

Examples

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

classifier <- RCAR(Species~., iris)
classifier

# make predictions for the first few instances of iris
predict(classifier, head(iris))

# inspect the rule base
inspect(rules(classifier))
# }

Run the code above in your browser using DataLab