Classification Based on Association Rules

Provides the infrastructure for association rule-based classification including the algorithms CBA, CMAR, CPAR, C4.5, FOIL, PART, PRM, RCAR, and RIPPER to build associative classifiers.

Travis-CI Build Status CRAN RStudio mirror downloads CRAN version

This R package is an extension of the package arules to perform association rule-based classification. It includes currently two classification algorithms. The first is the CBA algorithm described in Liu, et al. 1998. The second is a new weighted majority-vote based algorithm called bCBA which is currently being designed and tested. Time-critical sections of the code are implemented in C.

The package also provides support for supervised discretization and mining Class Association Rules (CARs).


Stable CRAN version: install from within R with


Current development version:



# learn a classifier using automatic default discretization
classifier <- CBA(Species ~ ., data = iris, supp = 0.05, conf = 0.9)
  CBA Classifier Object
  Class: Species=setosa, Species=versicolor, Species=virginica
  Default Class: Species=setosa
  Number of rules: 8
  Classification method: first 
  Description: CBA algorithm by Liu, et al. 1998 with support=0.05 and confidence=0.9
# make predictions for the first few instances of iris
predict(classifier, head(iris))
   [1] setosa setosa setosa setosa setosa setosa
   Levels: setosa versicolor virginica


  • 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.


arulesCBA 1.1.4 (2018-12-04)

  • discretizeDF.supervised method mdlp now produces a better error message if it fails.
  • cleaned up the predict code to improve speed.
  • mineCARs has now a balanced support option.
  • convenience function classFrequency added.

arulesCBA 1.1.3-1 (2018-04-23)

  • added new function discretizeDF.supervised for supervised discretization.
  • added new convenience function mineCARs to mine class association rules.
  • the formula interface now parsed the right hand side to restrict the used predictors.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.2.1 by Michael Hahsler, 7 days ago

Report a bug at

Browse source code at

Authors: Michael Hahsler [aut, cre, cph] , Ian Johnson [aut, cph] , Tyler Giallanza [ctb]

Documentation:   PDF Manual  

Task views: Model Deployment with R

GPL-3 license

Imports methods, discretization, glmnet

Depends on Matrix, arules

Suggests testthat, mlbench, rJava, RWeka

Suggested by arules, qCBA, tidybins.

See at CRAN