RWeka_CBA {arulesCBA}R Documentation

CBA classifiers based on rule-based classifiers in RWeka


Provides CBA-type classifiers based on RIPPER (Cohen, 1995), C4.5 (Quinlan, 1993) and PART (Frank and Witten, 1998) using the implementation in Weka via RWeka (Hornik et al, 2009). These classifiers do not mine CARs, but directly create rules.


RIPPER_CBA(formula, data, control = NULL, disc.method = "mdlp")

PART_CBA(formula, data, control = NULL, disc.method = "mdlp")

C4.5_CBA(formula, data, control = NULL, disc.method = "mdlp")



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


A data.frame or arules::transactions containing the training data. Data frames are automatically discretized and converted to transactions with prepareTransactions().


algorithmic control options for R/Weka Rule learners (see Details Section).


Discretization method used to discretize continuous variables if data is a data.frame (default: "mdlp"). See discretizeDF.supervised() for more supervised discretization methods.


You need to install package RWeka to use these classifiers.

See R/Weka functions RWeka::JRip() (RIPPER), RWeka::J48() (C4.5 rules), RWeka::PART() for algorithm details and how control options can be passed on via control. An example is given in the Examples Section below.

Memory for RWeka can be increased using the R options (e.g., options(java.parameters = "-Xmx1024m")) before RWeka or rJava is loaded or any RWeka-based classifier in this package is used.


Returns an object of class CBA representing the trained classifier.


Michael Hahsler


W. W. Cohen (1995). Fast effective rule induction. In A. Prieditis and S. Russell (eds.), Proceedings of the 12th International Conference on Machine Learning, pages 115-123. Morgan Kaufmann. ISBN 1-55860-377-8.

E. Frank and I. H. Witten (1998). Generating accurate rule sets without global optimization. In J. Shavlik (ed.), Machine Learning: Proceedings of the Fifteenth International Conference. Morgan Kaufmann Publishers: San Francisco, CA.

R. Quinlan (1993). C4.5: Programs for Machine Learning. Morgan Kaufmann Publishers, San Mateo, CA.

Hornik K, Buchta C, Zeileis A (2009). "Open-Source Machine Learning: R Meets Weka." Computational Statistics, 24(2), 225-232. doi:10.1007/s00180-008-0119-7

See Also

Other classifiers: CBA(), CBA_helpers, CBA_ruleset(), FOIL(), LUCS_KDD_CBA, RCAR()


# rJava and RWeka need to be installed

## Not run: 

# learn a classifier using automatic default discretization
classifier <- RIPPER_CBA(Species ~ ., data = iris)

# inspect the rule base

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

table(predict(classifier, iris), iris$Species)

# C4.5
classifier <- C4.5_CBA(Species ~ ., iris)

# To use algorithmic options (here for PART), you need to load RWeka

# control options can be found using the Weka Option Wizard (WOW)

# build PART with control option U (Generate unpruned decision list) set to TRUE
classifier <- PART_CBA(Species ~ ., data = iris, control = RWeka::Weka_control(U = TRUE))
predict(classifier, head(iris))

## End(Not run)

[Package arulesCBA version 1.2.7 Index]