| hanaml.FPGrowth {hana.ml.r} | R Documentation |
FP-Growth algorithm for association rule minining, based on PAL_FPGROWTH and PAL_FPGROWTH_RELATIONAL.
hanaml.FPGrowth(conn.context, data, used.cols = NULL,
min.support = NULL, min.confidence = NULL,
min.lift = NULL,
relational = FALSE, max.item.length = NULL,
max.consequent = NULL, ubiquitous = NULL,
lhs.restrict = NULL, rhs.complement.lhs = NULL,
rhs.restrict = NULL, lhs.complement.rhs = NULL,
timeout = NULL, thread.ratio = NULL)
conn.context |
|
data |
|
min.support |
|
min.confidence |
|
used.cols |
used.cols = list("transaction" = "CUSTOMER", "item" = "ITEM").
Transaction ID column defaults to the 1st column of |
relational |
|
min.lift |
|
max.item.length |
|
max.consequent |
|
ubiquitous |
|
lhs.restrict |
|
rhs.complement.lhs |
|
rhs.restrict |
|
lhs.complement.rhs |
|
timeout |
|
thread.ratio |
|
R6Class object.
An "FPGrowth" object with the following attributes:
result: DataFrame
Mined association rules as a whole.
Each rule has its antecedent/consequent items and support/confidence/lift values.
Available only when 'relatiional' is FALSE.
antecedent: DataFrame
Antecedent item information of mined association rules.
Available only when relational is TRUE.
consequent: DataFrame
Consequent item information of mined association rules.
Available only when relational is TRUE.
statistics: DataFrame
Support/confidence/lift values of mined association rules.
Available only when relational is TRUE.
model: DataFrame
Mined associtaional rules in PMML format.
Available only when pmml.export is 'single-row' or 'multi-row'.
## Not run:
> df
TRANS ITEM
1 1 1
2 1 2
3 2 2
4 2 3
5 2 4
6 3 1
7 3 3
8 3 4
9 3 5
10 4 1
11 4 4
12 4 5
13 5 1
14 5 2
15 6 1
16 6 2
17 6 3
18 6 4
19 7 1
20 8 1
21 8 2
22 8 3
23 9 1
24 9 2
25 9 3
26 10 2
27 10 3
28 10 5
> fpg <- hanaml.FPGrowth(conn.context = conn, data = df,
used.cols = c("transaction" = "TRANS", "item" = "ITEM"),
min.support = 0.2, min.confidence = 0.5,
max.item.length = 5, min.lift = 1,
max.consequent = 1, lhs.restrict = c(1,2,3),
timeout = 60)
> fpg$result
ANTECEDENT CONSEQUENT SUPPORT CONFIDENCE LIFT
1 2 3 0.5 0.7142857 1.190476
2 3 2 0.5 0.8333333 1.190476
3 3 4 0.3 0.5000000 1.250000
4 1&3 4 0.2 0.5000000 1.250000
5 1&2 3 0.3 0.6000000 1.000000
6 1&3 2 0.3 0.7500000 1.071429
## End(Not run)