hanaml.KORD.Rdhanaml.KORD is a R wrapper for SAP HANA PAL KORD.
hanaml.KORD( data, used.cols = NULL, k = NULL, max.antecedent = NULL, min.support = NULL, min.confidence = NULL, min.coverage = NULL, measure = NULL, epsilon = NULL, max.consequent = NULL, min.measure = NULL )
| data |
|
|---|---|
| used.cols |
Transaction ID column defaults to the 1st column of data and item ID column defaults to the 2nd column of data. |
| k |
|
| max.antecedent |
|
| min.support |
|
| min.confidence |
|
| min.coverage |
|
| measure |
|
| epsilon |
|
| max.consequent |
|
| min.measure |
|
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.
Input transaction DataFrame data:
> data$Collect() 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(data = data,
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