pkg <- 'stream' source("https://raw.githubusercontent.com/mhahsler/pkg_helpers/main/pkg_helpers.R") pkg_title(pkg)
This R package extends package arules with NBMiner, an implementation of the model-based mining algorithm for mining NB-frequent itemsets presented in "Michael Hahsler. A model-based frequency constraint for mining associations from transaction data. Data Mining and Knowledge Discovery, 13(2):137-166, September 2006." In addition an extension for NB-precise rules is implemented.
pkg_install(pkg)
Estimate NBD model parameters for the Agrawal data set.
library(arulesNBMiner) data("Agrawal") param <- NBMinerParameters(Agrawal.db, pi=0.99, theta=0.5, maxlen=5, minlen=1, trim = 0, verb = TRUE, plot=TRUE)
Mine NB-frequent itemsets
itemsets_NB <- NBMiner(Agrawal.db, parameter = param, control = list(verb = TRUE, debug=FALSE))
Inspect some itemsets with the highest precision.
inspect(head(itemsets_NB, by = "precision"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.