pruning {rCBA}R Documentation

A Pruning function

Description

A Pruning function

Usage

pruning(train, rules, method = "m2cba", verbose = TRUE,
  parallel = TRUE)

Arguments

train

trainData data.frame or transactions from arules with input data

rules

data.frame with rules

method

pruning method m2cba(default)|m1cba|dcbrcba

verbose

verbose indicator

parallel

parallel indicator

Value

data.frame with pruned rules

Examples

library("arules")
library("rCBA")
data("iris")

train <- sapply(iris,as.factor)
train <- data.frame(train, check.names=FALSE)
txns <- as(train,"transactions")

rules = apriori(txns, parameter=list(support=0.03, confidence=0.03, minlen=2),
appearance = list(rhs=c("Species=setosa", "Species=versicolor", "Species=virginica"),default="lhs"))

print(length(rules))
prunedRules <- rCBA::pruning(train, rules, method="m2cba", parallel=FALSE)
print(length(prunedRules))

[Package rCBA version 0.4.3 Index]