> library(arulesViz) > data<-read.table("C:/Users/admin/Desktop/data analysis/association analysis/data.csv",sep=",",header=TRUE) > head(data,5) ID ITEM 1 54 妝前晶亮隔離乳1 2 19 妝spa隔離乳1 3 98 妝spa隔離乳1 4 101 妝spa隔離乳1 5 239 妝spa隔離乳1 > data<-as(split(data$ITEM,data$ID),"transactions") > summary(data) transactions as itemMatrix in sparse format with 7014 rows (elements/itemsets/transactions) and 115 columns (items) and a density of 0.03842749 most frequent items: 凝水芳澤脣膏2 愛旅遊小姐旅行包約會去11 植物煥亮潔面乳1 植物煥亮柔膚水1 植物煥亮乳液1 (Other) 2792 2622 2200 2176 2136 19070 element (itemset/transaction) length distribution: sizes 1 2 3 4 5 6 25 187 342 3575 2039 846 Min. 1st Qu. Median Mean 3rd Qu. Max. 1.000 4.000 4.000 4.419 5.000 6.000 includes extended item information - examples: labels 1 (san)綿綿呼吸潔面乳1 2 (san)綿綿呼吸潔面乳2 3 (san)綿綿呼吸潔面乳3 includes extended transaction information - examples: transactionID 1 1 2 2 3 3 > rules<-apriori(data,parameter=list(support=0.1,confidence=0.3)) Apriori Parameter specification: confidence minval smax arem aval originalSupport maxtime support minlen maxlen target ext 0.3 0.1 1 none FALSE TRUE 5 0.1 1 10 rules FALSE Algorithmic control: filter tree heap memopt load sort verbose 0.1 TRUE TRUE FALSE TRUE 2 TRUE Absolute minimum support count: 701 set item appearances ...[0 item(s)] done [0.00s]. set transactions ...[115 item(s), 7014 transaction(s)] done [0.00s]. sorting and recoding items ... [15 item(s)] done [0.00s]. creating transaction tree ... done [0.00s]. checking subsets of size 1 2 3 4 done [0.00s]. writing ... [54 rule(s)] done [0.00s]. creating S4 object ... done [0.00s]. > inspect(rules) lhs rhs support confidence lift count [1] {} => {植物煥亮乳液1} 0.3045338 0.3045338 1.0000000 2136 [2] {} => {植物煥亮柔膚水1} 0.3102367 0.3102367 1.0000000 2176 [3] {} => {植物煥亮潔面乳1} 0.3136584 0.3136584 1.0000000 2200 [4] {} => {愛旅遊小姐旅行包約會去11} 0.3738238 0.3738238 1.0000000 2622 [5] {} => {凝水芳澤脣膏2} 0.3980610 0.3980610 1.0000000 2792 [6] {海洋多肽潔面乳1} => {海洋多肽活膚水1} 0.1017964 0.9902913 9.6070580 714 [7] {海洋多肽活膚水1} => {海洋多肽潔面乳1} 0.1017964 0.9875519 9.6070580 714 [8] {(san)拍拍煥醒早安乳1} => {(san)拍拍亮白化妝水1} 0.1331622 0.9957356 7.3439427 934 [9] {(san)拍拍亮白化妝水1} => {(san)拍拍煥醒早安乳1} 0.1331622 0.9821241 7.3439427 934 [10] {(san)拍拍煥醒早安乳1} => {(san)綿綿呼吸潔面乳1} 0.1333048 0.9968017 7.2828825 935 [11] {(san)綿綿呼吸潔面乳1} => {(san)拍拍煥醒早安乳1} 0.1333048 0.9739583 7.2828825 935 [12] {(san)拍拍亮白化妝水1} => {(san)綿綿呼吸潔面乳1} 0.1341603 0.9894848 7.2294230 941 [13] {(san)綿綿呼吸潔面乳1} => {(san)拍拍亮白化妝水1} 0.1341603 0.9802083 7.2294230 941 [14] {拍拍乾淨卸妝液1} => {凝水芳澤脣膏2} 0.1074993 0.8424581 2.1164044 754 [15] {亮透了粉底液02Natural天然1} => {愛旅遊小姐旅行包約會去11} 0.1411463 0.4957436 1.3261425 990 [16] {愛旅遊小姐旅行包約會去11} => {亮透了粉底液02Natural天然1} 0.1411463 0.3775744 1.3261425 990 [17] {亮透了粉底液02Natural天然1} => {凝水芳澤脣膏2} 0.2714571 0.9534301 2.3951859 1904 [18] {凝水芳澤脣膏2} => {亮透了粉底液02Natural天然1} 0.2714571 0.6819484 2.3951859 1904 [19] {植物煥亮乳液1} => {植物煥亮柔膚水1} 0.2982606 0.9794007 3.1569471 2092 [20] {植物煥亮柔膚水1} => {植物煥亮乳液1} 0.2982606 0.9613971 3.1569471 2092 [21] {植物煥亮乳液1} => {植物煥亮潔面乳1} 0.3018249 0.9911049 3.1598225 2117 [22] {植物煥亮潔面乳1} => {植物煥亮乳液1} 0.3018249 0.9622727 3.1598225 2117 [23] {植物煥亮乳液1} => {愛旅遊小姐旅行包約會去11} 0.1133447 0.3721910 0.9956322 795 [24] {愛旅遊小姐旅行包約會去11} => {植物煥亮乳液1} 0.1133447 0.3032037 0.9956322 795 [25] {植物煥亮柔膚水1} => {植物煥亮潔面乳1} 0.3072427 0.9903493 3.1574135 2155 [26] {植物煥亮潔面乳1} => {植物煥亮柔膚水1} 0.3072427 0.9795455 3.1574135 2155 [27] {植物煥亮柔膚水1} => {愛旅遊小姐旅行包約會去11} 0.1129170 0.3639706 0.9736421 792 [28] {愛旅遊小姐旅行包約會去11} => {植物煥亮柔膚水1} 0.1129170 0.3020595 0.9736421 792 [29] {植物煥亮潔面乳1} => {愛旅遊小姐旅行包約會去11} 0.1150556 0.3668182 0.9812596 807 [30] {愛旅遊小姐旅行包約會去11} => {植物煥亮潔面乳1} 0.1150556 0.3077803 0.9812596 807 [31] {愛旅遊小姐旅行包約會去11} => {凝水芳澤脣膏2} 0.2038780 0.5453852 1.3701045 1430 [32] {凝水芳澤脣膏2} => {愛旅遊小姐旅行包約會去11} 0.2038780 0.5121777 1.3701045 1430 [33] {(san)拍拍煥醒早安乳1,(san)拍拍亮白化妝水1} => {(san)綿綿呼吸潔面乳1} 0.1330197 0.9989293 7.2984275 933 [34] {(san)綿綿呼吸潔面乳1,(san)拍拍煥醒早安乳1} => {(san)拍拍亮白化妝水1} 0.1330197 0.9978610 7.3596181 933 [35] {(san)綿綿呼吸潔面乳1,(san)拍拍亮白化妝水1} => {(san)拍拍煥醒早安乳1} 0.1330197 0.9914984 7.4140403 933 [36] {愛旅遊小姐旅行包約會去11,亮透了粉底液02Natural天然1} => {凝水芳澤脣膏2} 0.1361563 0.9646465 2.4233633 955 [37] {亮透了粉底液02Natural天然1,凝水芳澤脣膏2} => {愛旅遊小姐旅行包約會去11} 0.1361563 0.5015756 1.3417435 955 [38] {愛旅遊小姐旅行包約會去11,凝水芳澤脣膏2} => {亮透了粉底液02Natural天然1} 0.1361563 0.6678322 2.3456058 955 [39] {植物煥亮柔膚水1,植物煥亮乳液1} => {植物煥亮潔面乳1} 0.2959795 0.9923518 3.1637980 2076 [40] {植物煥亮潔面乳1,植物煥亮乳液1} => {植物煥亮柔膚水1} 0.2959795 0.9806330 3.1609190 2076 [41] {植物煥亮潔面乳1,植物煥亮柔膚水1} => {植物煥亮乳液1} 0.2959795 0.9633411 3.1633306 2076 [42] {植物煥亮柔膚水1,植物煥亮乳液1} => {愛旅遊小姐旅行包約會去11} 0.1104933 0.3704589 0.9909987 775 [43] {愛旅遊小姐旅行包約會去11,植物煥亮乳液1} => {植物煥亮柔膚水1} 0.1104933 0.9748428 3.1422551 775 [44] {愛旅遊小姐旅行包約會去11,植物煥亮柔膚水1} => {植物煥亮乳液1} 0.1104933 0.9785354 3.2132242 775 [45] {植物煥亮潔面乳1,植物煥亮乳液1} => {愛旅遊小姐旅行包約會去11} 0.1126319 0.3731696 0.9982500 790 [46] {愛旅遊小姐旅行包約會去11,植物煥亮乳液1} => {植物煥亮潔面乳1} 0.1126319 0.9937107 3.1681304 790 [47] {愛旅遊小姐旅行包約會去11,植物煥亮潔面乳1} => {植物煥亮乳液1} 0.1126319 0.9789343 3.2145343 790 [48] {植物煥亮潔面乳1,植物煥亮柔膚水1} => {愛旅遊小姐旅行包約會去11} 0.1122042 0.3651972 0.9769234 787 [49] {愛旅遊小姐旅行包約會去11,植物煥亮柔膚水1} => {植物煥亮潔面乳1} 0.1122042 0.9936869 3.1680544 787 [50] {愛旅遊小姐旅行包約會去11,植物煥亮潔面乳1} => {植物煥亮柔膚水1} 0.1122042 0.9752169 3.1434609 787 [51] {植物煥亮潔面乳1,植物煥亮柔膚水1,植物煥亮乳液1} => {愛旅遊小姐旅行包約會去11} 0.1099230 0.3713873 0.9934822 771 [52] {愛旅遊小姐旅行包約會去11,植物煥亮柔膚水1,植物煥亮乳液1} => {植物煥亮潔面乳1} 0.1099230 0.9948387 3.1717267 771 [53] {愛旅遊小姐旅行包約會去11,植物煥亮潔面乳1,植物煥亮乳液1} => {植物煥亮柔膚水1} 0.1099230 0.9759494 3.1458221 771 [54] {愛旅遊小姐旅行包約會去11,植物煥亮潔面乳1,植物煥亮柔膚水1} => {植物煥亮乳液1} 0.1099230 0.9796696 3.2169489 771