apriori算法matlab频繁模式挖掘含代码原始数据.docx
《apriori算法matlab频繁模式挖掘含代码原始数据.docx》由会员分享,可在线阅读,更多相关《apriori算法matlab频繁模式挖掘含代码原始数据.docx(37页珍藏版)》请在冰豆网上搜索。
![apriori算法matlab频繁模式挖掘含代码原始数据.docx](https://file1.bdocx.com/fileroot1/2022-11/16/bac12909-24c4-4f56-9ee7-0fb6c144068c/bac12909-24c4-4f56-9ee7-0fb6c144068c1.gif)
apriori算法matlab频繁模式挖掘含代码原始数据
apriori算法matlab频繁模式挖掘
对购买记录进行频繁模式挖掘,采用apriori算法
本文档附带matlab算法以及一个案例:
附件:
BASKETS.txtBASKETS.xlsx在我的文库里
首先进行数据BASKETS.txt的预处理:
得到BASKETS.xlsx,(第二页)
Matlab代码函数:
一下是用附件做的案例主函数:
结果截图:
附原始数据:
cardid,value,pmethod,sex,homeown,income,age,fruitveg,freshmeat,dairy,cannedveg,cannedmeat,frozenmeal,beer,wine,softdrink,fish,confectionery
39808,42.7123,CHEQUE,M,NO,27000,46,F,T,T,F,F,F,F,F,F,F,T
67362,25.3567,CASH,F,NO,30000,28,F,T,F,F,F,F,F,F,F,F,T
10872,20.6176,CASH,M,NO,13200,36,F,F,F,T,F,T,T,F,F,T,F
26748,23.6883,CARD,F,NO,12200,26,F,F,T,F,F,F,F,T,F,F,F
91609,18.8133,CARD,M,YES,11000,24,F,F,F,F,F,F,F,F,F,F,F
26630,46.4867,CARD,F,NO,15000,35,F,T,F,F,F,F,F,T,F,T,F
62995,14.0467,CASH,F,YES,20800,30,T,F,F,F,F,F,F,F,T,F,F
38765,22.2034,CASH,M,YES,24400,22,F,F,F,F,F,F,T,F,F,F,F
28935,22.975,CHEQUE,F,NO,29500,46,T,F,F,F,F,T,F,F,F,F,F
41792,14.5692,CASH,M,NO,29600,22,T,F,F,F,F,F,F,F,F,T,F
59480,10.3282,CASH,F,NO,27100,18,T,T,T,T,F,F,F,T,F,T,F
60755,13.7796,CASH,F,YES,20000,48,T,F,F,F,F,F,F,F,F,T,F
70998,36.509,CARD,M,YES,27300,43,F,F,T,F,T,T,F,F,F,T,F
80617,10.2011,CHEQUE,F,YES,28000,43,F,F,F,F,F,F,F,F,T,T,F
61144,10.3736,CASH,F,NO,27400,24,T,F,T,F,F,F,F,F,T,T,F
36405,34.8222,CHEQUE,F,YES,18400,19,F,F,F,F,F,T,T,F,T,F,F
76567,42.248,CARD,M,YES,23100,31,T,F,F,T,F,F,F,F,F,T,F
85699,18.1688,CASH,F,YES,27000,29,F,F,F,F,F,F,F,F,F,T,F
11357,10.753,CASH,F,YES,23100,26,F,F,F,F,F,F,T,F,F,T,F
97761,32.3184,CARD,F,YES,25800,38,T,F,F,T,F,F,F,T,F,T,T
20362,31.72,CASH,M,YES,25100,38,F,F,F,F,F,T,F,F,F,T,F
33173,36.8328,CASH,F,YES,24700,43,F,F,F,F,F,F,F,T,F,F,T
69934,31.1787,CHEQUE,F,YES,21300,41,F,F,F,F,F,F,F,F,F,T,F
14743,21.6813,CASH,M,YES,12400,48,T,T,T,T,T,T,T,T,F,F,F
83071,29.8536,CASH,M,YES,18100,31,F,F,F,F,F,F,T,F,F,F,T
17571,15.27,CARD,F,YES,22900,23,T,F,T,F,F,T,T,F,F,F,F
37917,32.2318,CHEQUE,F,NO,27000,32,F,T,F,F,F,F,F,T,F,F,T
11236,42.5669,CARD,M,YES,26800,34,F,F,F,F,F,F,F,F,F,F,F
47914,44.5913,CASH,F,YES,24700,32,F,T,F,F,F,F,F,T,F,T,T
58154,49.1367,CHEQUE,M,NO,21300,50,F,F,F,F,T,F,F,F,F,F,F
35197,40.3398,CASH,M,NO,27400,38,F,F,F,F,F,T,T,T,F,T,F
64892,38.9995,CASH,F,YES,12900,46,F,F,F,F,F,T,F,T,F,F,F
102467,13.7623,CARD,F,YES,26700,48,F,F,F,T,T,F,T,T,F,F,F
56677,30.3099,CASH,F,NO,27800,42,T,F,F,F,F,F,F,F,F,F,F
94105,10.3719,CARD,M,YES,24100,44,F,T,F,F,F,F,F,F,T,F,F
63817,29.1748,CHEQUE,M,YES,19600,28,F,F,F,F,F,F,F,F,F,F,F
44887,46.8983,CARD,M,YES,28400,41,T,F,F,F,F,F,F,F,F,F,F
69720,13.7837,CARD,F,NO,16600,41,F,T,F,F,F,F,F,F,F,F,F
97267,33.0618,CHEQUE,F,YES,10200,19,F,F,F,F,F,F,F,F,F,T,T
53750,38.5113,CHEQUE,F,YES,24800,23,F,F,F,F,F,F,F,T,F,F,T
109530,37.4844,CARD,M,NO,21100,30,F,T,F,F,F,F,T,F,F,F,F
65493,26.7732,CASH,M,YES,19900,43,F,F,F,F,F,F,F,F,T,F,F
96694,28.2755,CARD,M,NO,16300,28,F,F,F,T,T,T,T,T,F,T,F
46730,41.6178,CARD,F,NO,18700,35,T,F,F,F,T,F,F,F,F,F,F
60499,11.8442,CASH,M,YES,12800,30,T,T,F,F,F,F,F,F,F,F,F
73004,13.0578,CHEQUE,M,YES,23800,18,F,F,F,F,F,F,F,T,F,F,F
21787,19.5369,CASH,M,NO,19700,45,F,F,F,F,F,F,F,F,F,T,F
28314,38.8062,CARD,F,YES,29200,37,F,F,F,F,F,T,F,T,F,F,T
24651,32.1216,CASH,F,NO,22700,37,F,F,F,F,F,F,F,T,T,F,T
29367,43.3149,CHEQUE,M,YES,28800,35,F,F,F,F,F,T,F,F,F,F,F
15072,41.6457,CARD,M,NO,28400,34,F,F,F,F,F,T,F,F,F,F,F
33622,39.2378,CASH,M,NO,26200,25,T,F,F,F,F,F,T,T,F,T,F
42167,10.6201,CARD,F,NO,11100,35,F,T,F,F,F,F,F,T,T,F,F
43550,10.5365,CASH,M,NO,10200,47,F,F,F,T,F,T,T,F,T,F,F
18724,49.1775,CASH,F,NO,13500,17,F,F,T,F,F,F,T,F,F,F,F
91019,48.4029,CARD,M,YES,24100,29,F,F,F,F,F,F,F,T,F,F,F
68193,15.7157,CARD,F,YES,29600,24,T,F,F,F,F,F,F,F,F,F,F
35262,26.2512,CHEQUE,M,YES,18100,22,T,F,F,T,F,F,T,T,F,F,F
93401,45.7963,CARD,F,YES,29700,25,F,F,F,F,F,F,F,T,F,T,T
15177,24.7919,CARD,F,NO,11700,46,F,F,F,F,F,F,F,F,F,F,T
96173,26.3483,CARD,F,NO,13800,31,F,F,F,F,F,F,F,F,T,F,F
50180,35.5435,CASH,M,YES,23700,42,F,F,F,T,T,F,F,F,T,F,T
31828,30.426,CARD,M,NO,12000,17,F,F,T,F,T,F,F,F,F,T,F
62022,42.7131,CASH,F,NO,13300,40,F,F,F,F,F,F,F,T,F,F,T
105225,28.5341,CASH,M,NO,21600,35,T,F,T,F,F,F,F,F,F,F,T
64668,31.2009,CASH,M,NO,11200,49,F,F,T,T,T,T,T,F,T,F,F
53320,46.27,CARD,M,YES,18200,39,F,F,F,F,T,F,F,F,T,T,F
15068,17.8948,CHEQUE,M,YES,21400,50,F,F,F,F,F,F,T,F,F,F,F
99849,37.0252,CASH,F,YES,11400,17,T,F,T,F,F,F,F,F,F,F,F
63694,22.3043,CARD,F,YES,11700,29,T,F,T,T,F,F,F,F,F,F,F
24874,35.938,CASH,F,YES,26700,46,T,T,T,F,F,F,F,T,F,F,T
104988,24.3263,CASH,M,NO,24800,39,F,F,F,F,T,F,F,F,F,F,F
84902,44.9991,CARD,M,YES,29600,50,F,F,F,F,F,T,F,F,F,F,F
96512,37.8721,CARD,F,NO,20500,43,T,F,F,F,F,F,T,T,F,F,T
99575,19.2134,CARD,M,YES,28100,38,F,F,F,F,F,T,F,F,F,T,F
33413,37.9016,CASH,F,NO,20700,39,F,F,F,F,F,T,F,T,F,F,T
57678,47.6595,CHEQUE,M,NO,24900,29,F,F,F,F,F,T,F,F,F,F,F
89425,28.8615,CHEQUE,M,NO,20300,17,T,F,F,T,F,F,T,F,F,T,F
60571,24.6707,CASH,F,NO,18600,29,F,F,F,F,F,T,F,F,F,T,F
76095,28.0024,CHEQUE,M,YES,11000,46,F,F,F,T,F,T,T,F,F,F,F
48247,48.6794,CHEQUE,F,NO,11000,50,F,F,F,F,F,F,F,F,F,F,F
88019,47.36