options(digits = 2) knitr::opts_chunk$set(tidy = TRUE, message = FALSE)
pkg <- 'arulesCBA' library(stringr) cat(str_interp("[![CRAN version](http://www.r-pkg.org/badges/version/${pkg})](https://CRAN.R-project.org/package=${pkg})\n")) cat(str_interp("[![stream r-universe status](https://mhahsler.r-universe.dev/badges/${pkg})](https://mhahsler.r-universe.dev/ui#package:${pkg})\n")) cat(str_interp("[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/grand-total/${pkg})](https://CRAN.R-project.org/package=${pkg})\n"))
The R package arulesCBA (Hahsler et al, 2020) is an extension of the package arules to perform association rule-based classification. The package provides the infrastructure for class association rules and implements associative classifiers based on the following algorithms:
The package also provides the infrastructure for associative classification (supervised discetization, mining class association rules (CARs)), and implements various association rule-based classification strategies (first match, majority voting, weighted voting, etc.).
Stable CRAN version: install from within R with
install.packages("arulesCBA")
Current development version: Install from r-universe.
library("arulesCBA") data("iris")
Learn a classifier.
classifier <- CBA(Species ~ ., data = iris) classifier
Inspect the rulebase.
inspect(rules(classifier), linebreak = TRUE)
Make predictions for the first few instances of iris.
predict(classifier, head(iris))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.