Description Usage Arguments Value Examples
A Pruning function
1 2 |
train |
trainData |
rules |
|
method |
pruning method m2cba(default)|m1cba|dcbrcba |
verbose |
verbose indicator |
parallel |
parallel indicator |
data.frame
with pruned rules
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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))
|
Loading required package: rJava
Loading required package: arules
Loading required package: Matrix
Attaching package: ‘arules’
The following objects are masked from ‘package:base’:
abbreviate, write
OpenJDK 64-Bit Server VM warning: Can't detect primordial thread stack location - find_vma failed
Warning message:
Column(s) 1, 2, 3, 4, 5 not logical or factor. Applying default discretization (see '? discretizeDF').
Apriori
Parameter specification:
confidence minval smax arem aval originalSupport maxtime support minlen
0.03 0.1 1 none FALSE TRUE 5 0.03 2
maxlen target ext
10 rules TRUE
Algorithmic control:
filter tree heap memopt load sort verbose
0.1 TRUE TRUE FALSE TRUE 2 TRUE
Absolute minimum support count: 4
set item appearances ...[3 item(s)] done [0.00s].
set transactions ...[126 item(s), 150 transaction(s)] done [0.00s].
sorting and recoding items ... [54 item(s)] done [0.00s].
creating transaction tree ... done [0.00s].
checking subsets of size 1 2 3 done [0.00s].
writing ... [52 rule(s)] done [0.00s].
creating S4 object ... done [0.00s].
[1] 52
2021-03-18 22:10:43 rCBA: initialized
2021-03-18 22:10:43 rCBA: data 150x5
took: 0.14 s
2021-03-18 22:10:43 rCBA: rules 52
took: 0.07 s
2021-03-18 22:10:43 rCBA: pruning completed
took: 0.13 s
2021-03-18 22:10:44 rCBA: pruned rules 26
took: 0.04 s
[1] 26
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.