发现在前天转载的Apriori algorithem中存在一点小的瑕疵,特更正如下。
# Apriori algorithem
def Apriori(filename,supct):
#get source data from file
srcdata=getsrcdata(filename)
# get C1
c=getC1(srcdata)
# L
L={}
LR={}
while True:
# temp L,if empty,over
# while not,this is the new L
temp_L=getL(c,supct)
if not temp_L:
break
else:
L=temp_L
for item in temp_L.keys():
LR[item]=temp_L[item] ###修改之处
# get the next candidate from pre L
c=getnextcandi(L,srcdata)
return LR
本文修正了Apriori算法实现中的一项小错误,并详细介绍了修正后的算法流程。包括从文件获取源数据、生成候选集C1、迭代计算频繁项集L及规则集合LR等关键步骤。
3549

被折叠的 条评论
为什么被折叠?



