1 / 19
文档名称:

数据挖掘Apriori算法.docx

格式:docx   大小:161KB   页数:19页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

数据挖掘Apriori算法.docx

上传人:zhuwo11 2022/7/20 文件大小:161 KB

下载得到文件列表

数据挖掘Apriori算法.docx

文档介绍

文档介绍:a TT TT 1/TOZ :回轴魏希
uoudv :灘牙目巫觀活
曙細嫌 嗥牙軸瞬
姓 名
学号
实验组
实验时间
指导教师
成绩
实验项目名称
Aprior算法
实验目的及要求:it2;
map< vector<string>,unsigned int >::iterator mit = ck_item_it2;
〃取当前第K级频繁项与其后面的第K级频繁项集联合,但要注意联合条件
〃联合条件:连个频繁项的前K-1项完全相同,只是第K项不同,然后两个联合生成 第K+1级候选频繁项
while(mit !=())
{
vector<string> vec,vec1,vec2;
vec1 = ck_item_it1->first;
vec2 = mit->first;
vector<string>::iterator vit1,vit2;
vit1 =();
vit2 =();
while (vit1 < () && vit2 < ())
{
string str1 = *vit1;
{
(strl);
(str2);
} map< int , vector<string> >::iterator base_item =();
unsigned int Acount = 0 ;
while (base_item !=())〃统计该K+1级候选项在原事务集出现次数 {
unsigned int count = 0 ,mincount = UINT_MAX; vector<string> vv = base_item->second;
vector<string>::iterator vecit , bvit ;
for (vecit = ();vecit < ();vecit++)
{
string t = *vecit;
count = 0;
for (bvit=();bvit < ();bvit++)
{
if (t == *bvit)
count++;
}
mincount = (count < mincount count : mincount );
}
if (mincount >=1 && mincount != UINT_MAX)
Acount += mincount;
++base_item;
if (Acount >= min_value && Acount != 0)
{
sort(),());
〃该第K+1级候选项为频繁项,插入频繁项集
ret =
pair< map< vector<string>,unsigned int >::iterator , boo卜 (make_pair(vec,Acount));
if (!
{
>second += Acount;
}
}
}
++mit;
}
++ck_item_it1;
}
if ())//该第K+1级频繁项集为空,说明调用结束,把上一级频繁项集返回
return K_item;
else
return ck_item;
}
}
void Apriori::showAprioriltem(unsigned int K,map< vector<string>,unsigned int > showmap)
{
map< vector<string>,unsigned int >::iterator showit =();
if (K != UINT_MAX)
1_! "C:\LI5ers\Administrator\Desktop\Debug\>e'
3586 luo ± 4 5 2 luo
7 9 M 8 luo 678? luo ±234 luo
2 0 6 7 luo 2014 luo
4 S 6 7 luo 6893 luo
:3 5 7 8 Iliq
endS13 end> : end>» end>- end> 5 end>» end>» end>^ end> 5 end>
l」n nrrTI-TTr Tn」「一 1-TTT JrTTTTT Jn _.-? 0t:务务升<#等夯<4fe 1 也皂一一£'=_二一一二一一一二__£•--二一-一 -=--=i一尊•一 寺-U- F.」三 F.」」--Fa-S- F74-----F -U-3U- -、^_一
^1^^-B- 1234G67R91 A人入人入人人人人人人入 「.■■g: i 一□-■■■- = = •■■■- =:■■■i 二"■-二:■■■-1 :■■■- -:■