Apriori algorithem 中需要修改的一段
2010-12-01 17:11
239 查看
发现在前天转载的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 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
相关文章推荐
- 织梦DEDECMS问答模块的一些需要修改的办法
- 代码修改mac地址(需要root)
- DEDECMS 修改 data&a 4000 mp;nbsp;文件夹名称需要…
- AndroidStudio 导入项目需要修改的地方
- U-Boot移植需要修改的文件
- 有关lomboz生成的ejb-jar。xml和jboss。xml文件需要修改地方的记录
- wampserver修改端口号后,phpMyAdmin进不去,需要修改相关配置文件
- 组件中引入 jquery 需要修改的地方
- android studio 导入github项目需要修改gradle信息
- s3c2410工作在258M频率需要修改的文件
- 快速定位*.class文件中需要修改的位置
- centos7 如果想让IP配置永久生效,需要修改配置文件
- javaEE之修改javaWeb服务器的项目名时需要注意的问题
- iOS7默认状态栏文字颜色为黑色,项目需要修改为白色。
- web项目改名字,无法访问,需要修改ContextPath路径
- laravel的模板中修改编辑的view表单form需要注意的问题
- 旧的项目需要修改项目路径以及包名,eclipse解决之道!!
- Linux安装oracle时需要修改的系统参数具体说明
- 今天需要修改学习的任务
- maven自动编译,解决你每次代码修改需要重新编译的繁琐