fpgrowth: FP-Growth

Description Usage Arguments Examples

View source: R/fpgrowth.R

Description

FP-Growth algorithm - Jiawei Han, Jian Pei, and Yiwen Yin. Mining frequent patterns without candidate generation. SIGMOD Rec. 29, 2 (2000) <doi:10.1145/335191.335372>

Usage

1
2
fpgrowth(train, support = 0.01, confidence = 1, maxLength = 5,
  consequent = NULL, verbose = TRUE, parallel = TRUE)

Arguments

train

data.frame or transactions from arules with input data

support

minimum support

confidence

minimum confidence

maxLength

maximum length

consequent

filter consequent - column name with consequent/target class

verbose

verbose indicator

parallel

parallel indicator

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library("rCBA")
data("iris")

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

rules = rCBA::fpgrowth(txns, support=0.03, confidence=0.03, maxLength=2, consequent="Species",
           parallel=FALSE)

predictions <- rCBA::classification(train,rules)
table(predictions)
sum(as.character(train$Species)==as.character(predictions),na.rm=TRUE)/length(predictions)

prunedRules <- rCBA::pruning(train, rules, method="m2cba", parallel=FALSE)
predictions <- rCBA::classification(train, prunedRules)
table(predictions)
sum(as.character(train$Species)==as.character(predictions),na.rm=TRUE)/length(predictions)

rCBA documentation built on May 17, 2018, 1:03 a.m.

Related to fpgrowth in rCBA...