| hanaml.Kord {hana.ml.r} | R Documentation |
K-optimal rule discovery (KORD) algorithm for association rule minining, based on PAL_KORD.
hanaml.Kord(conn.context,
data,
used.cols = NULL,
k = NULL,
max.antecedent = NULL,
min.support = NULL,
min.confidence = NULL,
min.coverage = NULL,
measure = NULL,
epsilon = NULL)
conn.context |
|
data |
|
used.cols |
used.cols = list("transaction" = "CUSTOMER", "item" = "ITEM").
Transaction ID column defaults to the 1st column of |
k |
|
max.antecedent |
|
min.support |
|
min.confidence |
|
min.coverage |
|
measure |
|
epsilon |
|
R6Class object.
A "Kord" object with the following attributes.
antecedent: DataFrame
Antecedent item information of mined association rules.
consequent: DataFrame
Consequent item information of mined association rules.
statistics: DataFrame
Support/confidence/lift values of mined association rules.
## Not run:
Input transaction data:
> df
CUSTOMER ITEM
1 2 item2
2 2 item3
3 3 item1
4 3 item2
5 3 item4
6 4 item1
7 4 item3
8 5 item2
9 5 item3
10 6 item1
11 6 item3
12 0 item1
13 0 item2
14 0 item5
15 1 item2
16 1 item4
17 7 item1
18 7 item2
19 7 item3
20 7 item5
21 8 item1
22 8 item2
23 8 item3
Creating an Kord object for mining association rules from the input data:
> kd <- hanaml.Kord(conn.context = conn, data = df,
used.cols = c("transaction" = "CUSTOMER",
"item" = "ITEM"),
min.support = 0.1, min.confidence = 0.2,
measure = "Lift", k = 5)
Check the mined association rules from the attributes of above Kord object:
> kd$antecedent
RULE_ID ANTECEDENT
1 0 item2
2 1 item1
3 2 item2
4 2 item1
5 3 item5
6 4 item2
> kd$consequent
RULE_ID CONSEQUENT
1 0 item5
2 1 item5
3 2 item5
4 3 item1
5 4 item4
> kd$statistics
RULE_ID SUPPORT CONFIDENCE LIFT LEVERAGE MEASURE
1 0 0.2222222 0.2857143 1.285714 0.04938272 1.285714
2 1 0.2222222 0.3333333 1.500000 0.07407407 1.500000
3 2 0.2222222 0.5000000 2.250000 0.12345679 2.250000
4 3 0.2222222 1.0000000 1.500000 0.07407407 1.500000
5 4 0.2222222 0.2857143 1.285714 0.04938272 1.285714
## End(Not run)