mirror of
https://github.com/apachecn/ailearning.git
synced 2026-11-26 05:41:53 +08:00
更新 Apriori 文档
This commit is contained in:
@@ -310,6 +310,8 @@ def testApriori():
|
||||
print 'L(0.7): ', L1
|
||||
print 'supportData(0.7): ', supportData1
|
||||
|
||||
print '->->->->->->->->->->->->->->->->->->->->->->->->->->->->'
|
||||
|
||||
# Apriori 算法生成频繁项集以及它们的支持度
|
||||
L2, supportData2 = apriori(dataSet, minSupport=0.5)
|
||||
print 'L(0.5): ', L2
|
||||
@@ -331,10 +333,10 @@ def testGenerateRules():
|
||||
|
||||
def main():
|
||||
# 测试 Apriori 算法
|
||||
# testApriori()
|
||||
testApriori()
|
||||
|
||||
# 生成关联规则
|
||||
testGenerateRules()
|
||||
# testGenerateRules()
|
||||
|
||||
# # 项目案例
|
||||
# # 构建美国国会投票记录的事务数据集
|
||||
|
||||
Reference in New Issue
Block a user