《机器学习实战Machine_Learning_in_Action》 CH11-毒蘑菇判断 by Apriori算法

本文主要是介绍《机器学习实战Machine_Learning_in_Action》 CH11-毒蘑菇判断 by Apriori算法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

寻找毒蘑菇

The first feature is poisonous or edible. If a sample is poisonous, you get a 1. If it’s edible,you get a 2.
在这里插入图片描述

导入数据

# apriori.py
import apriori# 加载数据
mushDatSet = [line.split() for line in open('mushroom.dat').readlines()]

计算支持度

L,suppData=apriori.apriori(mushDatSet, min_support=0.3)

计算关联规则

bigRuleList = apriori.generate_rules(L, suppData, 0.3)
# 导出2的特征
for i in range(len(bigRuleList)):if list(bigRuleList[i][1]) == ['2']:print(list(bigRuleList[i][0]),'--->',list(bigRuleList[i][1]),',几率为{:.0%}'.format(bigRuleList[i][2]))out:['23'] ---> ['2'] ,几率为82%
['34'] ---> ['2'] ,几率为51%
['36'] ---> ['2'] ,几率为44%
['59'] ---> ['2'] ,几率为70%
['63'] ---> ['2'] ,几率为69%
['67'] ---> ['2'] ,几率为62%
['76'] ---> ['2'] ,几率为62%
['85'] ---> ['2'] ,几率为52%
['86'] ---> ['2'] ,几率为51%
['90'] ---> ['2'] ,几率为49%
['93'] ---> ['2'] ,几率为79%
['39'] ---> ['2'] ,几率为70%
['28'] ---> ['2'] ,几率为97%
['53'] ---> ['2'] ,几率为56%
['23', '34'] ---> ['2'] ,几率为82%
['23', '36'] ---> ['2'] ,几率为81%
['23', '59'] ---> ['2'] ,几率为85%
['23', '63'] ---> ['2'] ,几率为84%
['23', '85'] ---> ['2'] ,几率为82%
['23', '86'] ---> ['2'] ,几率为82%
['23', '90'] ---> ['2'] ,几率为82%
['23', '93'] ---> ['2'] ,几率为80%
['34', '36'] ---> ['2'] ,几率为43%
['34', '59'] ---> ['2'] ,几率为69%
['34', '63'] ---> ['2'] ,几率为68%
['34', '67'] ---> ['2'] ,几率为62%
['34', '76'] ---> ['2'] ,几率为62%
['34', '85'] ---> ['2'] ,几率为51%
['34', '86'] ---> ['2'] ,几率为51%
['34', '90'] ---> ['2'] ,几率为48%
['34', '93'] ---> ['2'] ,几率为78%
['36', '59'] ---> ['2'] ,几率为68%
['36', '63'] ---> ['2'] ,几率为66%
['36', '85'] ---> ['2'] ,几率为44%
['86', '36'] ---> ['2'] ,几率为43%
['36', '90'] ---> ['2'] ,几率为43%
['36', '93'] ---> ['2'] ,几率为80%
['59', '63'] ---> ['2'] ,几率为75%
['59', '85'] ---> ['2'] ,几率为70%
['86', '59'] ---> ['2'] ,几率为69%
['90', '59'] ---> ['2'] ,几率为69%
['93', '59'] ---> ['2'] ,几率为82%
['63', '85'] ---> ['2'] ,几率为69%
['86', '63'] ---> ['2'] ,几率为68%
['90', '63'] ---> ['2'] ,几率为67%
['93', '63'] ---> ['2'] ,几率为81%
['67', '85'] ---> ['2'] ,几率为62%
['86', '67'] ---> ['2'] ,几率为62%
['85', '76'] ---> ['2'] ,几率为62%
['86', '76'] ---> ['2'] ,几率为62%
['86', '85'] ---> ['2'] ,几率为51%
['90', '85'] ---> ['2'] ,几率为49%
['93', '85'] ---> ['2'] ,几率为79%
['86', '90'] ---> ['2'] ,几率为48%
['86', '93'] ---> ['2'] ,几率为78%
['90', '93'] ---> ['2'] ,几率为79%
['23', '39'] ---> ['2'] ,几率为88%
['34', '39'] ---> ['2'] ,几率为69%
['36', '39'] ---> ['2'] ,几率为63%
['59', '39'] ---> ['2'] ,几率为94%
['63', '39'] ---> ['2'] ,几率为94%
['67', '39'] ---> ['2'] ,几率为87%
['39', '76'] ---> ['2'] ,几率为87%
['85', '39'] ---> ['2'] ,几率为70%
['86', '39'] ---> ['2'] ,几率为69%
['90', '39'] ---> ['2'] ,几率为68%
['93', '39'] ---> ['2'] ,几率为89%
['34', '28'] ---> ['2'] ,几率为96%
['34', '53'] ---> ['2'] ,几率为56%
['86', '28'] ---> ['2'] ,几率为97%
['86', '53'] ---> ['2'] ,几率为56%
['28', '59'] ---> ['2'] ,几率为97%
['28', '63'] ---> ['2'] ,几率为97%
['28', '85'] ---> ['2'] ,几率为97%
['53', '85'] ---> ['2'] ,几率为56%
['90', '28'] ---> ['2'] ,几率为98%
['90', '53'] ---> ['2'] ,几率为56%
['28', '39'] ---> ['2'] ,几率为98%
['53', '39'] ---> ['2'] ,几率为90%
['53', '28'] ---> ['2'] ,几率为100%
['34', '36', '23'] ---> ['2'] ,几率为81%
['34', '23', '59'] ---> ['2'] ,几率为85%
['34', '23', '63'] ---> ['2'] ,几率为84%
['34', '23', '85'] ---> ['2'] ,几率为82%
['86', '34', '23'] ---> ['2'] ,几率为82%
['34', '90', '23'] ---> ['2'] ,几率为82%
['34', '93', '23'] ---> ['2'] ,几率为80%
['23', '36', '59'] ---> ['2'] ,几率为85%
['23', '36', '63'] ---> ['2'] ,几率为84%
['23', '36', '85'] ---> ['2'] ,几率为81%
['86', '36', '23'] ---> ['2'] ,几率为81%
['23', '36', '93'] ---> ['2'] ,几率为80%
['23', '63', '59'] ---> ['2'] ,几率为86%
['23', '59', '85'] ---> ['2'] ,几率为85%
['86', '23', '59'] ---> ['2'] ,几率为85%
['23', '90', '59'] ---> ['2'] ,几率为86%
['23', '93', '59'] ---> ['2'] ,几率为84%
['23', '63', '85'] ---> ['2'] ,几率为84%
['86', '23', '63'] ---> ['2'] ,几率为84%
['86', '23', '85'] ---> ['2'] ,几率为82%
['23', '90', '85'] ---> ['2'] ,几率为82%
['23', '93', '85'] ---> ['2'] ,几率为80%
['86', '90', '23'] ---> ['2'] ,几率为82%
['86', '93', '23'] ---> ['2'] ,几率为80%
['23', '90', '93'] ---> ['2'] ,几率为82%
['34', '36', '59'] ---> ['2'] ,几率为66%
['34', '36', '63'] ---> ['2'] ,几率为64%
['34', '36', '85'] ---> ['2'] ,几率为43%
['86', '36', '34'] ---> ['2'] ,几率为43%
['34', '36', '90'] ---> ['2'] ,几率为41%
['34', '36', '93'] ---> ['2'] ,几率为78%
['34', '63', '59'] ---> ['2'] ,几率为74%
['34', '59', '85'] ---> ['2'] ,几率为69%
['86', '34', '59'] ---> ['2'] ,几率为69%
['34', '90', '59'] ---> ['2'] ,几率为68%
['34', '93', '59'] ---> ['2'] ,几率为81%
['34', '63', '85'] ---> ['2'] ,几率为68%
['86', '34', '63'] ---> ['2'] ,几率为68%
['34', '90', '63'] ---> ['2'] ,几率为66%
['34', '93', '63'] ---> ['2'] ,几率为80%
['34', '67', '85'] ---> ['2'] ,几率为62%
['86', '34', '67'] ---> ['2'] ,几率为62%
['34', '85', '76'] ---> ['2'] ,几率为62%
['86', '34', '76'] ---> ['2'] ,几率为62%
['86', '34', '85'] ---> ['2'] ,几率为51%
['34', '90', '85'] ---> ['2'] ,几率为48%
['34', '93', '85'] ---> ['2'] ,几率为78%
['86', '34', '90'] ---> ['2'] ,几率为48%
['86', '34', '93'] ---> ['2'] ,几率为78%
['34', '90', '93'] ---> ['2'] ,几率为78%
['36', '59', '63'] ---> ['2'] ,几率为75%
['36', '59', '85'] ---> ['2'] ,几率为68%
['36', '90', '59'] ---> ['2'] ,几率为67%
['36', '93', '59'] ---> ['2'] ,几率为83%
['36', '63', '85'] ---> ['2'] ,几率为66%
['36', '90', '63'] ---> ['2'] ,几率为65%
['36', '93', '63'] ---> ['2'] ,几率为82%
['36', '90', '85'] ---> ['2'] ,几率为43%
['36', '93', '85'] ---> ['2'] ,几率为80%
['86', '36', '59'] ---> ['2'] ,几率为66%
['86', '36', '63'] ---> ['2'] ,几率为64%
['86', '36', '85'] ---> ['2'] ,几率为43%
['86', '36', '90'] ---> ['2'] ,几率为41%
['86', '36', '93'] ---> ['2'] ,几率为78%
['36', '90', '93'] ---> ['2'] ,几率为81%
['63', '59', '85'] ---> ['2'] ,几率为75%
['86', '63', '59'] ---> ['2'] ,几率为74%
['86', '59', '85'] ---> ['2'] ,几率为69%
['86', '90', '59'] ---> ['2'] ,几率为68%
['86', '93', '59'] ---> ['2'] ,几率为81%
['63', '90', '59'] ---> ['2'] ,几率为75%
['90', '59', '85'] ---> ['2'] ,几率为69%
['90', '93', '59'] ---> ['2'] ,几率为82%
['63', '93', '59'] ---> ['2'] ,几率为82%
['93', '59', '85'] ---> ['2'] ,几率为82%
['86', '63', '85'] ---> ['2'] ,几率为68%
['86', '90', '63'] ---> ['2'] ,几率为66%
['86', '93', '63'] ---> ['2'] ,几率为80%
['90', '63', '85'] ---> ['2'] ,几率为67%
['90', '93', '63'] ---> ['2'] ,几率为81%
['93', '63', '85'] ---> ['2'] ,几率为81%
['86', '67', '85'] ---> ['2'] ,几率为62%
['86', '85', '76'] ---> ['2'] ,几率为62%
['86', '90', '85'] ---> ['2'] ,几率为48%
['86', '93', '85'] ---> ['2'] ,几率为78%
['90', '93', '85'] ---> ['2'] ,几率为79%
['86', '90', '93'] ---> ['2'] ,几率为78%
['34', '23', '39'] ---> ['2'] ,几率为88%
['23', '36', '39'] ---> ['2'] ,几率为88%
['23', '59', '39'] ---> ['2'] ,几率为92%
['23', '63', '39'] ---> ['2'] ,几率为92%
['23', '85', '39'] ---> ['2'] ,几率为88%
['86', '23', '39'] ---> ['2'] ,几率为88%
['23', '93', '39'] ---> ['2'] ,几率为87%
['34', '36', '39'] ---> ['2'] ,几率为61%
['34', '59', '39'] ---> ['2'] ,几率为94%
['34', '63', '39'] ---> ['2'] ,几率为93%
['34', '67', '39'] ---> ['2'] ,几率为87%
['34', '39', '76'] ---> ['2'] ,几率为87%
['34', '85', '39'] ---> ['2'] ,几率为69%
['86', '34', '39'] ---> ['2'] ,几率为69%
['34', '90', '39'] ---> ['2'] ,几率为67%
['34', '93', '39'] ---> ['2'] ,几率为88%
['36', '59', '39'] ---> ['2'] ,几率为93%
['36', '63', '39'] ---> ['2'] ,几率为92%
['36', '85', '39'] ---> ['2'] ,几率为63%
['86', '36', '39'] ---> ['2'] ,几率为61%
['36', '90', '39'] ---> ['2'] ,几率为62%
['36', '93', '39'] ---> ['2'] ,几率为88%
['63', '59', '39'] ---> ['2'] ,几率为95%
['39', '59', '85'] ---> ['2'] ,几率为94%
['86', '59', '39'] ---> ['2'] ,几率为94%
['90', '59', '39'] ---> ['2'] ,几率为95%
['93', '59', '39'] ---> ['2'] ,几率为93%
['63', '85', '39'] ---> ['2'] ,几率为94%
['86', '63', '39'] ---> ['2'] ,几率为93%
['90', '63', '39'] ---> ['2'] ,几率为95%
['93', '63', '39'] ---> ['2'] ,几率为92%
['39', '67', '85'] ---> ['2'] ,几率为87%
['86', '67', '39'] ---> ['2'] ,几率为87%
['85', '39', '76'] ---> ['2'] ,几率为87%
['86', '39', '76'] ---> ['2'] ,几率为87%
['86', '85', '39'] ---> ['2'] ,几率为69%
['90', '85', '39'] ---> ['2'] ,几率为68%
['93', '85', '39'] ---> ['2'] ,几率为89%
['86', '90', '39'] ---> ['2'] ,几率为67%
['86', '93', '39'] ---> ['2'] ,几率为88%
['90', '93', '39'] ---> ['2'] ,几率为90%
['34', '28', '59'] ---> ['2'] ,几率为97%
['34', '28', '63'] ---> ['2'] ,几率为97%
['34', '28', '85'] ---> ['2'] ,几率为96%
['34', '53', '85'] ---> ['2'] ,几率为56%
['86', '34', '28'] ---> ['2'] ,几率为97%
['86', '34', '53'] ---> ['2'] ,几率为56%
['34', '28', '90'] ---> ['2'] ,几率为98%
['34', '53', '90'] ---> ['2'] ,几率为56%
['86', '28', '59'] ---> ['2'] ,几率为97%
['86', '28', '63'] ---> ['2'] ,几率为97%
['86', '28', '85'] ---> ['2'] ,几率为97%
['86', '53', '85'] ---> ['2'] ,几率为56%
['86', '28', '90'] ---> ['2'] ,几率为99%
['86', '53', '90'] ---> ['2'] ,几率为56%
['34', '28', '39'] ---> ['2'] ,几率为98%
['34', '53', '39'] ---> ['2'] ,几率为90%
['34', '53', '28'] ---> ['2'] ,几率为100%
['86', '28', '39'] ---> ['2'] ,几率为98%
['86', '53', '39'] ---> ['2'] ,几率为90%
['86', '53', '28'] ---> ['2'] ,几率为100%
['63', '28', '59'] ---> ['2'] ,几率为97%
['28', '59', '85'] ---> ['2'] ,几率为97%
['90', '28', '59'] ---> ['2'] ,几率为100%
['28', '59', '39'] ---> ['2'] ,几率为97%
['28', '63', '85'] ---> ['2'] ,几率为97%
['28', '63', '39'] ---> ['2'] ,几率为97%
['90', '28', '85'] ---> ['2'] ,几率为98%
['28', '85', '39'] ---> ['2'] ,几率为98%
['90', '53', '85'] ---> ['2'] ,几率为56%
['53', '85', '39'] ---> ['2'] ,几率为90%
['28', '53', '85'] ---> ['2'] ,几率为100%
['28', '90', '39'] ---> ['2'] ,几率为100%
['53', '90', '39'] ---> ['2'] ,几率为90%
['53', '90', '28'] ---> ['2'] ,几率为100%
['28', '53', '39'] ---> ['2'] ,几率为100%
['86', '36', '23', '59'] ---> ['2'] ,几率为85%
['23', '36', '93', '59'] ---> ['2'] ,几率为84%
['86', '36', '93', '23'] ---> ['2'] ,几率为80%
['86', '93', '59', '23'] ---> ['2'] ,几率为84%
['86', '36', '59', '34'] ---> ['2'] ,几率为66%
['34', '36', '93', '59'] ---> ['2'] ,几率为82%
['86', '36', '93', '34'] ---> ['2'] ,几率为78%
['86', '34', '93', '59'] ---> ['2'] ,几率为81%
['36', '90', '93', '59'] ---> ['2'] ,几率为85%
['36', '93', '59', '63'] ---> ['2'] ,几率为84%
['36', '93', '59', '85'] ---> ['2'] ,几率为83%
['86', '36', '59', '63'] ---> ['2'] ,几率为73%
['86', '36', '59', '85'] ---> ['2'] ,几率为66%
['86', '36', '90', '59'] ---> ['2'] ,几率为65%
['86', '36', '93', '59'] ---> ['2'] ,几率为82%
['86', '36', '93', '85'] ---> ['2'] ,几率为78%
['86', '36', '90', '93'] ---> ['2'] ,几率为80%
['86', '90', '93', '59'] ---> ['2'] ,几率为81%
['86', '63', '93', '59'] ---> ['2'] ,几率为81%
['86', '93', '59', '85'] ---> ['2'] ,几率为81%
['34', '36', '23', '63'] ---> ['2'] ,几率为84%
['34', '36', '23', '85'] ---> ['2'] ,几率为81%
['34', '36', '23', '39'] ---> ['2'] ,几率为88%
['34', '63', '23', '59'] ---> ['2'] ,几率为86%
['34', '23', '59', '85'] ---> ['2'] ,几率为85%
['34', '90', '59', '23'] ---> ['2'] ,几率为86%
['34', '23', '59', '39'] ---> ['2'] ,几率为92%
['34', '23', '63', '85'] ---> ['2'] ,几率为84%
['34', '23', '63', '39'] ---> ['2'] ,几率为92%
['34', '90', '85', '23'] ---> ['2'] ,几率为82%
['34', '23', '85', '39'] ---> ['2'] ,几率为88%
['86', '34', '23', '63'] ---> ['2'] ,几率为84%
['86', '34', '23', '85'] ---> ['2'] ,几率为82%
['86', '34', '90', '23'] ---> ['2'] ,几率为82%
['86', '34', '23', '39'] ---> ['2'] ,几率为88%
['34', '93', '85', '23'] ---> ['2'] ,几率为80%
['34', '90', '93', '23'] ---> ['2'] ,几率为82%
['34', '93', '39', '23'] ---> ['2'] ,几率为87%
['34', '36', '23', '59'] ---> ['2'] ,几率为85%
['23', '36', '59', '63'] ---> ['2'] ,几率为86%
['23', '36', '59', '85'] ---> ['2'] ,几率为85%
['23', '36', '59', '39'] ---> ['2'] ,几率为92%
['23', '36', '63', '85'] ---> ['2'] ,几率为84%
['23', '36', '63', '39'] ---> ['2'] ,几率为92%
['23', '36', '85', '39'] ---> ['2'] ,几率为88%
['86', '36', '23', '34'] ---> ['2'] ,几率为81%
['86', '36', '23', '63'] ---> ['2'] ,几率为84%
['86', '36', '23', '85'] ---> ['2'] ,几率为81%
['86', '36', '23', '39'] ---> ['2'] ,几率为88%
['34', '36', '93', '23'] ---> ['2'] ,几率为80%
['23', '36', '93', '85'] ---> ['2'] ,几率为80%
['23', '36', '93', '39'] ---> ['2'] ,几率为87%
['23', '63', '59', '85'] ---> ['2'] ,几率为86%
['23', '63', '59', '39'] ---> ['2'] ,几率为94%
['23', '90', '59', '85'] ---> ['2'] ,几率为86%
['23', '85', '59', '39'] ---> ['2'] ,几率为92%
['86', '34', '23', '59'] ---> ['2'] ,几率为85%
['86', '63', '23', '59'] ---> ['2'] ,几率为86%
['86', '23', '59', '85'] ---> ['2'] ,几率为85%
['86', '90', '23', '59'] ---> ['2'] ,几率为86%
['86', '23', '59', '39'] ---> ['2'] ,几率为92%
['34', '93', '59', '23'] ---> ['2'] ,几率为84%
['23', '90', '93', '59'] ---> ['2'] ,几率为86%
['23', '93', '59', '85'] ---> ['2'] ,几率为84%
['23', '93', '59', '39'] ---> ['2'] ,几率为92%
['23', '85', '63', '39'] ---> ['2'] ,几率为92%
['86', '23', '63', '85'] ---> ['2'] ,几率为84%
['86', '23', '63', '39'] ---> ['2'] ,几率为92%
['86', '90', '23', '85'] ---> ['2'] ,几率为82%
['86', '23', '85', '39'] ---> ['2'] ,几率为88%
['23', '90', '93', '85'] ---> ['2'] ,几率为82%
['23', '93', '85', '39'] ---> ['2'] ,几率为87%
['86', '34', '93', '23'] ---> ['2'] ,几率为80%
['86', '93', '85', '23'] ---> ['2'] ,几率为80%
['86', '90', '93', '23'] ---> ['2'] ,几率为82%
['86', '93', '39', '23'] ---> ['2'] ,几率为87%
['34', '36', '59', '63'] ---> ['2'] ,几率为73%
['34', '36', '59', '85'] ---> ['2'] ,几率为66%
['34', '36', '90', '59'] ---> ['2'] ,几率为65%
['34', '36', '59', '39'] ---> ['2'] ,几率为92%
['34', '36', '63', '85'] ---> ['2'] ,几率为64%
['34', '36', '63', '39'] ---> ['2'] ,几率为92%
['34', '36', '90', '85'] ---> ['2'] ,几率为41%
['34', '36', '85', '39'] ---> ['2'] ,几率为61%
['86', '36', '63', '34'] ---> ['2'] ,几率为64%
['86', '36', '85', '34'] ---> ['2'] ,几率为43%
['86', '36', '90', '34'] ---> ['2'] ,几率为41%
['86', '36', '39', '34'] ---> ['2'] ,几率为61%
['34', '36', '93', '85'] ---> ['2'] ,几率为78%
['34', '36', '90', '93'] ---> ['2'] ,几率为80%
['34', '36', '93', '39'] ---> ['2'] ,几率为87%
['34', '63', '59', '85'] ---> ['2'] ,几率为74%
['34', '63', '90', '59'] ---> ['2'] ,几率为73%
['34', '63', '59', '39'] ---> ['2'] ,几率为95%
['34', '90', '59', '85'] ---> ['2'] ,几率为68%
['34', '85', '59', '39'] ---> ['2'] ,几率为94%
['86', '34', '59', '63'] ---> ['2'] ,几率为74%
['86', '34', '59', '85'] ---> ['2'] ,几率为69%
['86', '34', '90', '59'] ---> ['2'] ,几率为68%
['86', '34', '59', '39'] ---> ['2'] ,几率为94%
['34', '90', '59', '39'] ---> ['2'] ,几率为95%
['34', '90', '93', '59'] ---> ['2'] ,几率为81%
['34', '63', '93', '59'] ---> ['2'] ,几率为81%
['34', '93', '59', '85'] ---> ['2'] ,几率为81%
['34', '93', '59', '39'] ---> ['2'] ,几率为92%
['34', '85', '63', '39'] ---> ['2'] ,几率为93%
['86', '34', '63', '85'] ---> ['2'] ,几率为68%
['86', '34', '90', '63'] ---> ['2'] ,几率为66%
['86', '34', '63', '39'] ---> ['2'] ,几率为93%
['34', '90', '63', '85'] ---> ['2'] ,几率为66%
['34', '90', '63', '39'] ---> ['2'] ,几率为95%
['34', '93', '63', '85'] ---> ['2'] ,几率为80%
['34', '85', '67', '39'] ---> ['2'] ,几率为87%
['86', '34', '67', '85'] ---> ['2'] ,几率为62%
['86', '34', '67', '39'] ---> ['2'] ,几率为87%
['34', '85', '39', '76'] ---> ['2'] ,几率为87%
['86', '34', '85', '76'] ---> ['2'] ,几率为62%
['86', '34', '39', '76'] ---> ['2'] ,几率为87%
['86', '34', '90', '85'] ---> ['2'] ,几率为48%
['86', '34', '85', '39'] ---> ['2'] ,几率为69%
['34', '90', '85', '39'] ---> ['2'] ,几率为67%
['34', '90', '93', '85'] ---> ['2'] ,几率为78%
['34', '93', '85', '39'] ---> ['2'] ,几率为88%
['86', '34', '90', '39'] ---> ['2'] ,几率为67%
['86', '34', '93', '63'] ---> ['2'] ,几率为80%
['86', '34', '93', '85'] ---> ['2'] ,几率为78%
['86', '34', '90', '93'] ---> ['2'] ,几率为78%
['86', '34', '93', '39'] ---> ['2'] ,几率为88%
['36', '59', '85', '63'] ---> ['2'] ,几率为75%
['36', '90', '59', '63'] ---> ['2'] ,几率为75%
['36', '59', '39', '63'] ---> ['2'] ,几率为95%
['36', '90', '59', '85'] ---> ['2'] ,几率为67%
['36', '85', '59', '39'] ---> ['2'] ,几率为93%
['36', '90', '59', '39'] ---> ['2'] ,几率为95%
['36', '93', '59', '39'] ---> ['2'] ,几率为92%
['36', '85', '63', '39'] ---> ['2'] ,几率为92%
['36', '90', '63', '85'] ---> ['2'] ,几率为65%
['36', '93', '63', '85'] ---> ['2'] ,几率为82%
['36', '90', '93', '63'] ---> ['2'] ,几率为84%
['36', '93', '63', '39'] ---> ['2'] ,几率为92%
['36', '90', '85', '39'] ---> ['2'] ,几率为62%
['36', '90', '93', '85'] ---> ['2'] ,几率为81%
['36', '93', '85', '39'] ---> ['2'] ,几率为88%
['86', '36', '59', '39'] ---> ['2'] ,几率为92%
['86', '36', '63', '85'] ---> ['2'] ,几率为64%
['86', '36', '63', '39'] ---> ['2'] ,几率为92%
['86', '36', '90', '85'] ---> ['2'] ,几率为41%
['86', '36', '85', '39'] ---> ['2'] ,几率为61%
['86', '36', '93', '39'] ---> ['2'] ,几率为87%
['36', '90', '93', '39'] ---> ['2'] ,几率为90%
['63', '85', '59', '39'] ---> ['2'] ,几率为95%
['86', '63', '59', '85'] ---> ['2'] ,几率为74%
['86', '63', '90', '59'] ---> ['2'] ,几率为73%
['86', '63', '59', '39'] ---> ['2'] ,几率为95%
['86', '90', '59', '85'] ---> ['2'] ,几率为68%
['86', '85', '59', '39'] ---> ['2'] ,几率为94%
['86', '90', '59', '39'] ---> ['2'] ,几率为95%
['86', '93', '59', '39'] ---> ['2'] ,几率为92%
['63', '90', '59', '85'] ---> ['2'] ,几率为75%
['63', '90', '59', '39'] ---> ['2'] ,几率为97%
['85', '90', '59', '39'] ---> ['2'] ,几率为95%
['63', '90', '93', '59'] ---> ['2'] ,几率为83%
['90', '93', '59', '85'] ---> ['2'] ,几率为82%
['90', '93', '59', '39'] ---> ['2'] ,几率为95%
['63', '93', '59', '85'] ---> ['2'] ,几率为82%
['63', '93', '59', '39'] ---> ['2'] ,几率为95%
['85', '93', '59', '39'] ---> ['2'] ,几率为93%
['86', '85', '63', '39'] ---> ['2'] ,几率为93%
['86', '90', '63', '85'] ---> ['2'] ,几率为66%
['86', '90', '63', '39'] ---> ['2'] ,几率为95%
['86', '93', '63', '85'] ---> ['2'] ,几率为80%
['85', '90', '63', '39'] ---> ['2'] ,几率为95%
['90', '93', '63', '85'] ---> ['2'] ,几率为81%
['85', '93', '63', '39'] ---> ['2'] ,几率为92%
['86', '85', '67', '39'] ---> ['2'] ,几率为87%
['86', '85', '39', '76'] ---> ['2'] ,几率为87%
['86', '90', '85', '39'] ---> ['2'] ,几率为67%
['86', '90', '93', '85'] ---> ['2'] ,几率为78%
['86', '93', '85', '39'] ---> ['2'] ,几率为88%
['90', '93', '85', '39'] ---> ['2'] ,几率为90%
['34', '28', '59', '85'] ---> ['2'] ,几率为97%
['86', '34', '28', '59'] ---> ['2'] ,几率为97%
['86', '34', '28', '63'] ---> ['2'] ,几率为97%
['86', '34', '28', '85'] ---> ['2'] ,几率为97%
['86', '34', '53', '85'] ---> ['2'] ,几率为56%
['34', '90', '28', '85'] ---> ['2'] ,几率为98%
['34', '90', '53', '85'] ---> ['2'] ,几率为56%
['86', '34', '90', '28'] ---> ['2'] ,几率为99%
['86', '34', '90', '53'] ---> ['2'] ,几率为56%
['86', '28', '59', '85'] ---> ['2'] ,几率为97%
['86', '90', '28', '85'] ---> ['2'] ,几率为99%
['86', '90', '53', '85'] ---> ['2'] ,几率为56%
['34', '28', '59', '39'] ---> ['2'] ,几率为97%
['86', '34', '28', '39'] ---> ['2'] ,几率为98%
['86', '34', '53', '39'] ---> ['2'] ,几率为90%
['34', '90', '28', '39'] ---> ['2'] ,几率为100%
['34', '90', '53', '39'] ---> ['2'] ,几率为90%['86', '28', '59', '39'] ---> ['2'] ,几率为97%
['86', '90', '28', '39'] ---> ['2'] ,几率为100%
['86', '90', '53', '39'] ---> ['2'] ,几率为90%
['34', '28', '63', '85'] ---> ['2'] ,几率为97%
['34', '28', '63', '39'] ---> ['2'] ,几率为97%
['34', '28', '85', '39'] ---> ['2'] ,几率为98%
['34', '53', '28', '85'] ---> ['2'] ,几率为100%
['34', '53', '85', '39'] ---> ['2'] ,几率为90%
['86', '34', '53', '28'] ---> ['2'] ,几率为100%
['34', '90', '53', '28'] ---> ['2'] ,几率为100%
['86', '28', '63', '85'] ---> ['2'] ,几率为97%
['86', '28', '63', '39'] ---> ['2'] ,几率为97%
['86', '28', '85', '39'] ---> ['2'] ,几率为98%
['86', '53', '28', '85'] ---> ['2'] ,几率为100%
['86', '53', '85', '39'] ---> ['2'] ,几率为90%
['86', '90', '53', '28'] ---> ['2'] ,几率为100%
['34', '53', '28', '39'] ---> ['2'] ,几率为100%
['86', '53', '28', '39'] ---> ['2'] ,几率为100%
['63', '28', '59', '85'] ---> ['2'] ,几率为97%
['90', '28', '59', '85'] ---> ['2'] ,几率为100%
['85', '28', '59', '39'] ---> ['2'] ,几率为97%
['85', '28', '63', '39'] ---> ['2'] ,几率为97%
['90', '28', '85', '39'] ---> ['2'] ,几率为100%
['90', '53', '28', '85'] ---> ['2'] ,几率为100%
['90', '53', '85', '39'] ---> ['2'] ,几率为90%
['53', '28', '85', '39'] ---> ['2'] ,几率为100%
['90', '53', '28', '39'] ---> ['2'] ,几率为100%
['86', '36', '93', '59', '23'] ---> ['2'] ,几率为84%
['86', '36', '93', '59', '34'] ---> ['2'] ,几率为82%
['86', '36', '93', '59', '85'] ---> ['2'] ,几率为82%
['86', '36', '93', '59', '90'] ---> ['2'] ,几率为84%
['86', '36', '34', '59', '23'] ---> ['2'] ,几率为85%
['86', '36', '59', '23', '63'] ---> ['2'] ,几率为86%
['86', '36', '59', '23', '85'] ---> ['2'] ,几率为85%
['86', '36', '39', '59', '23'] ---> ['2'] ,几率为92%
['36', '93', '59', '34', '23'] ---> ['2'] ,几率为84%
['36', '93', '59', '23', '85'] ---> ['2'] ,几率为84%
['36', '93', '39', '59', '23'] ---> ['2'] ,几率为92%
['86', '36', '93', '34', '23'] ---> ['2'] ,几率为80%
['86', '36', '93', '23', '85'] ---> ['2'] ,几率为80%
['86', '36', '93', '39', '23'] ---> ['2'] ,几率为87%
['86', '93', '59', '34', '23'] ---> ['2'] ,几率为84%
['86', '93', '59', '23', '90'] ---> ['2'] ,几率为86%
['86', '93', '59', '23', '85'] ---> ['2'] ,几率为84%
['86', '93', '39', '59', '23'] ---> ['2'] ,几率为92%
['86', '36', '59', '34', '63'] ---> ['2'] ,几率为73%
['86', '36', '59', '34', '85'] ---> ['2'] ,几率为66%
['86', '36', '59', '34', '90'] ---> ['2'] ,几率为65%
['86', '36', '39', '59', '34'] ---> ['2'] ,几率为92%
['36', '93', '59', '34', '90'] ---> ['2'] ,几率为84%
['36', '93', '59', '34', '85'] ---> ['2'] ,几率为82%
['36', '93', '39', '59', '34'] ---> ['2'] ,几率为92%
['86', '36', '93', '34', '85'] ---> ['2'] ,几率为78%
['86', '36', '93', '34', '90'] ---> ['2'] ,几率为80%
['86', '36', '93', '39', '34'] ---> ['2'] ,几率为87%
['86', '93', '59', '34', '90'] ---> ['2'] ,几率为81%
['86', '93', '59', '34', '63'] ---> ['2'] ,几率为81%
['86', '93', '59', '34', '85'] ---> ['2'] ,几率为81%
['86', '93', '39', '59', '34'] ---> ['2'] ,几率为92%
['36', '93', '59', '90', '63'] ---> ['2'] ,几率为86%
['36', '93', '59', '90', '85'] ---> ['2'] ,几率为85%
['36', '93', '39', '59', '90'] ---> ['2'] ,几率为95%
['36', '93', '63', '59', '85'] ---> ['2'] ,几率为84%
['36', '93', '39', '59', '63'] ---> ['2'] ,几率为94%
['36', '93', '39', '59', '85'] ---> ['2'] ,几率为92%
['86', '36', '63', '59', '85'] ---> ['2'] ,几率为73%
['86', '36', '39', '59', '63'] ---> ['2'] ,几率为94%
['86', '36', '59', '90', '85'] ---> ['2'] ,几率为65%
['86', '36', '39', '59', '85'] ---> ['2'] ,几率为92%
['86', '36', '93', '39', '59'] ---> ['2'] ,几率为92%
['86', '36', '93', '90', '85'] ---> ['2'] ,几率为80%
['86', '36', '93', '39', '85'] ---> ['2'] ,几率为87%
['86', '93', '59', '90', '85'] ---> ['2'] ,几率为81%
['86', '93', '59', '63', '85'] ---> ['2'] ,几率为81%
['86', '93', '39', '59', '85'] ---> ['2'] ,几率为92%
['36', '34', '23', '63', '85'] ---> ['2'] ,几率为84%
['36', '39', '34', '23', '63'] ---> ['2'] ,几率为92%
['36', '39', '34', '23', '85'] ---> ['2'] ,几率为88%
['59', '34', '23', '63', '85'] ---> ['2'] ,几率为86%
['23', '59', '34', '90', '85'] ---> ['2'] ,几率为86%
['39', '59', '34', '23', '63'] ---> ['2'] ,几率为94%
['39', '59', '34', '23', '85'] ---> ['2'] ,几率为92%
['39', '63', '34', '23', '85'] ---> ['2'] ,几率为92%
['86', '34', '23', '63', '85'] ---> ['2'] ,几率为84%
['86', '23', '34', '90', '85'] ---> ['2'] ,几率为82%
['86', '39', '34', '23', '63'] ---> ['2'] ,几率为92%
['86', '39', '34', '23', '85'] ---> ['2'] ,几率为88%
['93', '23', '34', '90', '85'] ---> ['2'] ,几率为82%
['93', '39', '34', '23', '85'] ---> ['2'] ,几率为87%
['36', '59', '34', '23', '63'] ---> ['2'] ,几率为86%
['36', '59', '34', '23', '85'] ---> ['2'] ,几率为85%
['36', '63', '59', '23', '85'] ---> ['2'] ,几率为86%
['36', '39', '59', '34', '23'] ---> ['2'] ,几率为92%
['36', '39', '59', '23', '63'] ---> ['2'] ,几率为94%
['36', '39', '59', '23', '85'] ---> ['2'] ,几率为92%
['36', '39', '63', '23', '85'] ---> ['2'] ,几率为92%
['86', '36', '34', '23', '63'] ---> ['2'] ,几率为84%
['86', '36', '34', '23', '85'] ---> ['2'] ,几率为81%
['86', '36', '23', '63', '85'] ---> ['2'] ,几率为84%
['86', '36', '34', '39', '23'] ---> ['2'] ,几率为88%
['86', '36', '39', '23', '63'] ---> ['2'] ,几率为92%
['86', '36', '39', '23', '85'] ---> ['2'] ,几率为88%
['36', '93', '34', '23', '85'] ---> ['2'] ,几率为80%
['36', '93', '39', '34', '23'] ---> ['2'] ,几率为87%
['36', '93', '39', '23', '85'] ---> ['2'] ,几率为87%
['39', '59', '23', '63', '85'] ---> ['2'] ,几率为94%
['86', '59', '34', '23', '63'] ---> ['2'] ,几率为86%
['86', '59', '34', '23', '85'] ---> ['2'] ,几率为85%
['86', '23', '59', '34', '90'] ---> ['2'] ,几率为86%
['86', '59', '23', '63', '85'] ---> ['2'] ,几率为86%
['86', '59', '23', '90', '85'] ---> ['2'] ,几率为86%
['86', '39', '59', '34', '23'] ---> ['2'] ,几率为92%
['86', '39', '59', '23', '63'] ---> ['2'] ,几率为94%
['86', '39', '59', '23', '85'] ---> ['2'] ,几率为92%
['93', '23', '59', '34', '90'] ---> ['2'] ,几率为86%
['93', '59', '34', '23', '85'] ---> ['2'] ,几率为84%
['93', '59', '23', '90', '85'] ---> ['2'] ,几率为86%
['93', '39', '59', '34', '23'] ---> ['2'] ,几率为92%
['93', '39', '59', '23', '85'] ---> ['2'] ,几率为92%
['86', '39', '63', '23', '85'] ---> ['2'] ,几率为92%
['86', '93', '34', '23', '85'] ---> ['2'] ,几率为80%
['86', '93', '23', '34', '90'] ---> ['2'] ,几率为82%
['86', '93', '23', '90', '85'] ---> ['2'] ,几率为82%
['86', '93', '39', '34', '23'] ---> ['2'] ,几率为87%
['86', '93', '39', '23', '85'] ---> ['2'] ,几率为87%
['36', '63', '59', '34', '85'] ---> ['2'] ,几率为73%
['36', '59', '34', '90', '85'] ---> ['2'] ,几率为65%
['36', '39', '59', '34', '63'] ---> ['2'] ,几率为94%
['36', '39', '59', '34', '85'] ---> ['2'] ,几率为92%
['36', '39', '63', '34', '85'] ---> ['2'] ,几率为92%
['86', '36', '34', '63', '85'] ---> ['2'] ,几率为64%
['86', '36', '34', '90', '85'] ---> ['2'] ,几率为41%
['86', '36', '39', '34', '63'] ---> ['2'] ,几率为92%
['86', '36', '39', '34', '85'] ---> ['2'] ,几率为61%
['36', '93', '34', '90', '85'] ---> ['2'] ,几率为80%
['36', '93', '39', '34', '85'] ---> ['2'] ,几率为87%
['59', '34', '90', '63', '85'] ---> ['2'] ,几率为73%
['39', '59', '34', '63', '85'] ---> ['2'] ,几率为95%
['39', '59', '34', '90', '85'] ---> ['2'] ,几率为95%
['86', '63', '59', '34', '85'] ---> ['2'] ,几率为74%
['86', '59', '34', '90', '63'] ---> ['2'] ,几率为73%
['86', '59', '34', '90', '85'] ---> ['2'] ,几率为68%
['86', '39', '59', '34', '63'] ---> ['2'] ,几率为95%
['86', '39', '59', '34', '85'] ---> ['2'] ,几率为94%
['86', '39', '59', '34', '90'] ---> ['2'] ,几率为95%
['93', '59', '34', '90', '85'] ---> ['2'] ,几率为81%
['93', '59', '34', '63', '85'] ---> ['2'] ,几率为81%
['93', '39', '59', '34', '85'] ---> ['2'] ,几率为92%
['86', '34', '90', '63', '85'] ---> ['2'] ,几率为66%
['86', '39', '63', '34', '85'] ---> ['2'] ,几率为93%
['86', '39', '34', '90', '63'] ---> ['2'] ,几率为95%
['39', '63', '34', '90', '85'] ---> ['2'] ,几率为95%
['86', '39', '67', '34', '85'] ---> ['2'] ,几率为87%
['86', '39', '76', '34', '85'] ---> ['2'] ,几率为87%
['86', '39', '34', '90', '85'] ---> ['2'] ,几率为67%
['86', '93', '34', '63', '85'] ---> ['2'] ,几率为80%
['86', '93', '34', '90', '85'] ---> ['2'] ,几率为78%
['86', '93', '39', '34', '85'] ---> ['2'] ,几率为88%
['36', '63', '59', '90', '85'] ---> ['2'] ,几率为75%
['36', '39', '63', '59', '85'] ---> ['2'] ,几率为95%
['36', '39', '59', '90', '85'] ---> ['2'] ,几率为95%
['36', '93', '90', '63', '85'] ---> ['2'] ,几率为84%
['36', '93', '39', '63', '85'] ---> ['2'] ,几率为92%
['36', '93', '39', '90', '85'] ---> ['2'] ,几率为90%
['86', '36', '39', '63', '85'] ---> ['2'] ,几率为92%
['86', '59', '90', '63', '85'] ---> ['2'] ,几率为73%
['86', '39', '59', '63', '85'] ---> ['2'] ,几率为95%
['86', '39', '59', '90', '85'] ---> ['2'] ,几率为95%
['39', '63', '59', '90', '85'] ---> ['2'] ,几率为97%
['93', '59', '90', '63', '85'] ---> ['2'] ,几率为83%
['93', '39', '59', '90', '85'] ---> ['2'] ,几率为95%
['93', '39', '63', '59', '85'] ---> ['2'] ,几率为95%
['86', '39', '63', '90', '85'] ---> ['2'] ,几率为95%
['86', '28', '59', '34', '85'] ---> ['2'] ,几率为97%
['86', '28', '39', '59', '34'] ---> ['2'] ,几率为97%
['86', '28', '34', '63', '85'] ---> ['2'] ,几率为97%
['86', '28', '34', '90', '85'] ---> ['2'] ,几率为99%
['86', '53', '34', '90', '85'] ---> ['2'] ,几率为56%
['28', '39', '59', '34', '85'] ---> ['2'] ,几率为97%
['86', '28', '39', '34', '90'] ---> ['2'] ,几率为100%
['86', '28', '39', '34', '63'] ---> ['2'] ,几率为97%
['86', '28', '39', '34', '85'] ---> ['2'] ,几率为98%
['86', '53', '39', '34', '90'] ---> ['2'] ,几率为90%
['86', '53', '39', '34', '85'] ---> ['2'] ,几率为90%
['28', '39', '34', '90', '85'] ---> ['2'] ,几率为100%
['53', '39', '34', '90', '85'] ---> ['2'] ,几率为90%
['86', '28', '39', '59', '85'] ---> ['2'] ,几率为97%
['86', '28', '39', '90', '85'] ---> ['2'] ,几率为100%
['86', '53', '39', '90', '85'] ---> ['2'] ,几率为90%
['28', '39', '63', '34', '85'] ---> ['2'] ,几率为97%
['28', '53', '34', '90', '85'] ---> ['2'] ,几率为100%
['86', '28', '53', '34', '85'] ---> ['2'] ,几率为100%
['86', '28', '53', '34', '90'] ---> ['2'] ,几率为100%
['86', '28', '53', '39', '34'] ---> ['2'] ,几率为100%
['86', '28', '39', '63', '85'] ---> ['2'] ,几率为97%
['86', '28', '53', '90', '85'] ---> ['2'] ,几率为100%
['86', '53', '28', '39', '85'] ---> ['2'] ,几率为100%
['86', '28', '53', '39', '90'] ---> ['2'] ,几率为100%
['28', '53', '39', '34', '85'] ---> ['2'] ,几率为100%
['28', '53', '39', '34', '90'] ---> ['2'] ,几率为100%
['28', '53', '39', '90', '85'] ---> ['2'] ,几率为100%
['86', '36', '93', '59', '34', '23'] ---> ['2'] ,几率为84%
['86', '36', '93', '59', '23', '85'] ---> ['2'] ,几率为84%
['86', '36', '93', '59', '34', '85'] ---> ['2'] ,几率为82%
['86', '36', '93', '59', '34', '90'] ---> ['2'] ,几率为84%
['86', '36', '93', '59', '90', '85'] ---> ['2'] ,几率为84%
['86', '36', '34', '59', '23', '63'] ---> ['2'] ,几率为86%
['86', '36', '34', '59', '23', '85'] ---> ['2'] ,几率为85%
['86', '36', '59', '23', '63', '85'] ---> ['2'] ,几率为86%
['86', '36', '39', '59', '34', '23'] ---> ['2'] ,几率为92%
['86', '36', '39', '59', '23', '63'] ---> ['2'] ,几率为94%
['86', '36', '39', '59', '23', '85'] ---> ['2'] ,几率为92%
['36', '93', '59', '34', '23', '85'] ---> ['2'] ,几率为84%
['36', '93', '39', '59', '34', '23'] ---> ['2'] ,几率为92%
['36', '93', '39', '59', '23', '85'] ---> ['2'] ,几率为92%
['86', '36', '93', '34', '23', '85'] ---> ['2'] ,几率为80%
['86', '36', '93', '39', '59', '23'] ---> ['2'] ,几率为92%
['86', '36', '93', '39', '34', '23'] ---> ['2'] ,几率为87%
['86', '36', '93', '39', '23', '85'] ---> ['2'] ,几率为87%
['86', '93', '23', '59', '34', '90'] ---> ['2'] ,几率为86%
['86', '93', '59', '34', '23', '85'] ---> ['2'] ,几率为84%
['86', '93', '59', '23', '90', '85'] ---> ['2'] ,几率为86%
['86', '93', '39', '59', '34', '23'] ---> ['2'] ,几率为92%
['86', '93', '39', '59', '23', '85'] ---> ['2'] ,几率为92%
['86', '36', '59', '34', '63', '85'] ---> ['2'] ,几率为73%
['86', '36', '59', '34', '90', '85'] ---> ['2'] ,几率为65%
['86', '36', '39', '59', '34', '63'] ---> ['2'] ,几率为94%
['86', '36', '39', '59', '34', '85'] ---> ['2'] ,几率为92%
['36', '93', '59', '34', '90', '85'] ---> ['2'] ,几率为84%
['36', '93', '39', '59', '34', '85'] ---> ['2'] ,几率为92%
['86', '36', '93', '34', '90', '85'] ---> ['2'] ,几率为80%
['86', '36', '93', '39', '59', '34'] ---> ['2'] ,几率为92%
['86', '36', '93', '39', '34', '85'] ---> ['2'] ,几率为87%
['86', '93', '59', '34', '90', '85'] ---> ['2'] ,几率为81%
['86', '93', '59', '34', '63', '85'] ---> ['2'] ,几率为81%
['86', '93', '39', '59', '34', '85'] ---> ['2'] ,几率为92%
['36', '93', '59', '90', '63', '85'] ---> ['2'] ,几率为86%
['36', '93', '39', '59', '90', '85'] ---> ['2'] ,几率为95%
['36', '93', '39', '59', '63', '85'] ---> ['2'] ,几率为94%
['86', '36', '39', '59', '63', '85'] ---> ['2'] ,几率为94%
['86', '36', '93', '39', '59', '85'] ---> ['2'] ,几率为92%
['36', '39', '34', '23', '63', '85'] ---> ['2'] ,几率为92%
['39', '59', '34', '23', '63', '85'] ---> ['2'] ,几率为94%
['86', '39', '34', '23', '63', '85'] ---> ['2'] ,几率为92%
['36', '59', '34', '23', '63', '85'] ---> ['2'] ,几率为86%
['36', '39', '59', '34', '23', '63'] ---> ['2'] ,几率为94%
['36', '39', '59', '34', '23', '85'] ---> ['2'] ,几率为92%
['36', '39', '59', '23', '63', '85'] ---> ['2'] ,几率为94%
['86', '36', '34', '23', '63', '85'] ---> ['2'] ,几率为84%
['86', '36', '34', '39', '23', '63'] ---> ['2'] ,几率为92%
['86', '36', '34', '39', '23', '85'] ---> ['2'] ,几率为88%
['86', '36', '39', '23', '63', '85'] ---> ['2'] ,几率为92%
['36', '93', '39', '34', '23', '85'] ---> ['2'] ,几率为87%
['86', '59', '34', '23', '63', '85'] ---> ['2'] ,几率为86%
['86', '23', '59', '34', '90', '85'] ---> ['2'] ,几率为86%
['86', '39', '59', '34', '23', '63'] ---> ['2'] ,几率为94%
['86', '39', '59', '34', '23', '85'] ---> ['2'] ,几率为92%
['86', '39', '59', '23', '63', '85'] ---> ['2'] ,几率为94%
['93', '23', '59', '34', '90', '85'] ---> ['2'] ,几率为86%
['93', '39', '59', '34', '23', '85'] ---> ['2'] ,几率为92%
['86', '93', '23', '34', '90', '85'] ---> ['2'] ,几率为82%
['86', '93', '39', '34', '23', '85'] ---> ['2'] ,几率为87%
['36', '39', '59', '34', '63', '85'] ---> ['2'] ,几率为94%
['86', '36', '39', '34', '63', '85'] ---> ['2'] ,几率为92%
['86', '59', '34', '90', '63', '85'] ---> ['2'] ,几率为73%
['86', '39', '59', '34', '63', '85'] ---> ['2'] ,几率为95%
['86', '39', '59', '34', '90', '85'] ---> ['2'] ,几率为95%
['86', '39', '34', '90', '63', '85'] ---> ['2'] ,几率为95%
['86', '28', '39', '59', '34', '85'] ---> ['2'] ,几率为97%
['86', '28', '39', '34', '90', '85'] ---> ['2'] ,几率为100%
['86', '28', '39', '34', '63', '85'] ---> ['2'] ,几率为97%
['86', '53', '39', '34', '90', '85'] ---> ['2'] ,几率为90%
['86', '53', '28', '34', '90', '85'] ---> ['2'] ,几率为100%
['86', '53', '28', '39', '34', '85'] ---> ['2'] ,几率为100%
['86', '53', '28', '39', '34', '90'] ---> ['2'] ,几率为100%
['86', '28', '53', '39', '90', '85'] ---> ['2'] ,几率为100%
['53', '28', '39', '34', '90', '85'] ---> ['2'] ,几率为100%
['86', '36', '93', '59', '34', '23', '85'] ---> ['2'] ,几率为84%
['86', '36', '93', '59', '34', '90', '85'] ---> ['2'] ,几率为84%
['86', '36', '59', '34', '23', '63', '85'] ---> ['2'] ,几率为86%
['86', '36', '39', '59', '34', '23', '63'] ---> ['2'] ,几率为94%
['86', '36', '39', '59', '34', '23', '85'] ---> ['2'] ,几率为92%
['86', '36', '39', '59', '23', '63', '85'] ---> ['2'] ,几率为94%
['36', '93', '39', '59', '34', '23', '85'] ---> ['2'] ,几率为92%
['86', '36', '93', '34', '39', '59', '23'] ---> ['2'] ,几率为92%
['86', '36', '93', '39', '59', '23', '85'] ---> ['2'] ,几率为92%
['86', '36', '93', '39', '34', '23', '85'] ---> ['2'] ,几率为87%
['86', '93', '34', '59', '23', '90', '85'] ---> ['2'] ,几率为86%
['86', '93', '39', '59', '34', '23', '85'] ---> ['2'] ,几率为92%
['86', '36', '39', '59', '34', '63', '85'] ---> ['2'] ,几率为94%
['86', '36', '93', '39', '59', '34', '85'] ---> ['2'] ,几率为92%
['36', '39', '59', '34', '23', '63', '85'] ---> ['2'] ,几率为94%
['86', '36', '39', '34', '23', '63', '85'] ---> ['2'] ,几率为92%
['86', '39', '59', '34', '23', '63', '85'] ---> ['2'] ,几率为94%
['86', '53', '28', '39', '34', '90', '85'] ---> ['2'] ,几率为100%
['86', '36', '39', '59', '34', '23', '63', '85'] ---> ['2'] ,几率为94%
['86', '36', '93', '34', '39', '59', '23', '85'] ---> ['2'] ,几率为92%

apriori.py

from numpy import *# 加载数据集
def load_data_arr():return [[1, 3, 4], [2, 3, 5], [1, 2, 3, 5], [2, 5]]# 初始化候选项集,创建元素个数为1的候选项集
def create_set_0(data_arr):# 数组set_0 = []# 对每一条交易记录for transaction in data_arr:# 对交易记录中的每件物品for item in transaction:# 如果该物品没有出现在候选项集中,则添加if not [item] in set_0:set_0.append([item])set_0.sort()# 返回一个冻结的集合,集合冻结后不能再添加或者删除元素return map(frozenset, set_0)# 扫描交易记录集,计算每个候选项集的支持度,返回满足条件的频繁项集以及所有候选项集的支持度
def scan_data_set(data_set_list, set_k, min_support):set_k_list = list(set_k)# 候选项集计数items_cnt = {}for transaction in data_set_list:for items in set_k_list:if items.issubset(transaction):if items not in items_cnt:items_cnt[items] = 1else:items_cnt[items] += 1num_transaction = len(data_set_list)# 数组return_set_k = []# 字典support_data = {}for items in items_cnt.keys():# 计算每个候选项集的支持度support = items_cnt[items]/num_transaction# 判断项集的支持度是否满足最小支持度if support >= min_support:return_set_k.append(items)# 保存每个候选项集的支持度support_data[items] = supportreturn return_set_k, support_data# 根据项个数为k+1的频繁项集set_k,生成项个数为k+2的候选项集set_k_plus
def apriori_gen(set_k, k):return_set_k_plus = []num_set_k = len(set_k)for i in range(num_set_k):for j in range(i+1, num_set_k):l1 = list(set_k[i])[:k]l2 = list(set_k[j])[:k]l1.sort()l2.sort()if l1 == l2:return_set_k_plus.append(set_k[i] | set_k[j])    #set unionreturn return_set_k_plusdef apriori(data_arr, min_support=0.3):# 创建项个数为1的候选项集set_0 = create_set_0(data_arr)data_set_list = list(map(set, data_arr))# 计算项个数为1的频繁项集set_0_scanned, all_support = scan_data_set(data_set_list, set_0, min_support)# 将项个数为1的频繁项集放入到总的频繁项集中,下标为0s = [set_0_scanned]k = 0while len(s[k]) > 0:# 根据项个数为k+1的频繁项集set_k,生成项个数为k+2的候选项集set_k_plusset_k_plus = apriori_gen(s[k], k)# 计算项个数为k+2的频繁项集set_k_plus_scannedset_k_plus_scanned, k_plus_support = scan_data_set(data_set_list, set_k_plus, min_support)# 更新all_support.update(k_plus_support)s.append(set_k_plus_scanned)k += 1return s, all_support# 计算规则的可信度
def calculate_conf(freq_item, H, support_data, big_rules_list, min_conf=0.3):pruned_H = []for consequence in H:# 通过支持度计算可信度# 规则的左侧通过作差求得conf = support_data[freq_item]/support_data[freq_item - consequence]if conf >= min_conf:big_rules_list.append((freq_item - consequence, consequence, conf))# 需要返回可信的规则的右侧,以便再次进行合并,同时抛弃不可信规则的右侧pruned_H.append(consequence)return pruned_H# 从序列中提取规则
# H是规则的右侧
def rules_from_consequence(freq_item, H, support_data, big_rules_list, min_conf=0.3):m = len(H[0])# 原书代码中此处没有等号,是不对的,读者可以结合前面给出的结束条件,判断此处是否需要添加等号if len(freq_item) >= (m+1):# 下面的两行代码,原书给出的顺序是错误的,应该先计算可信度,再合并# 读者可以根据计算出的频繁项集和支持度手动计算一下,可以发现原执行顺序会漏掉一部分规则hmp1 = calculate_conf(freq_item, H, support_data, big_rules_list, min_conf)hmp1 = apriori_gen(hmp1, m - 1)# 下面这行代码使没有用的,因为合并右侧后,肯定是需要去提取规则并计算规则可信度的。# if len(hmp1) > 1:rules_from_consequence(freq_item, hmp1, support_data, big_rules_list, min_conf)# 生成关联规则
def generate_rules(s, support_data, min_conf=0.3):big_rules_list = []for i in range(1, len(s)):for freq_set in s[i]:h1 = [frozenset([item]) for item in freq_set]if i > 1:# 项数大于2,至少为3,可以组合项,提取规则rules_from_consequence(freq_set, h1, support_data, big_rules_list, min_conf)else:calculate_conf(freq_set, h1, support_data, big_rules_list, min_conf)return big_rules_list

部分代码源自于https://blog.csdn.net/dzjin1234/article/details/105799974

这篇关于《机器学习实战Machine_Learning_in_Action》 CH11-毒蘑菇判断 by Apriori算法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/700089

相关文章

网页解析 lxml 库--实战

lxml库使用流程 lxml 是 Python 的第三方解析库,完全使用 Python 语言编写,它对 XPath表达式提供了良好的支 持,因此能够了高效地解析 HTML/XML 文档。本节讲解如何通过 lxml 库解析 HTML 文档。 pip install lxml lxm| 库提供了一个 etree 模块,该模块专门用来解析 HTML/XML 文档,下面来介绍一下 lxml 库

HarmonyOS学习(七)——UI(五)常用布局总结

自适应布局 1.1、线性布局(LinearLayout) 通过线性容器Row和Column实现线性布局。Column容器内的子组件按照垂直方向排列,Row组件中的子组件按照水平方向排列。 属性说明space通过space参数设置主轴上子组件的间距,达到各子组件在排列上的等间距效果alignItems设置子组件在交叉轴上的对齐方式,且在各类尺寸屏幕上表现一致,其中交叉轴为垂直时,取值为Vert

Ilya-AI分享的他在OpenAI学习到的15个提示工程技巧

Ilya(不是本人,claude AI)在社交媒体上分享了他在OpenAI学习到的15个Prompt撰写技巧。 以下是详细的内容: 提示精确化:在编写提示时,力求表达清晰准确。清楚地阐述任务需求和概念定义至关重要。例:不用"分析文本",而用"判断这段话的情感倾向:积极、消极还是中性"。 快速迭代:善于快速连续调整提示。熟练的提示工程师能够灵活地进行多轮优化。例:从"总结文章"到"用

不懂推荐算法也能设计推荐系统

本文以商业化应用推荐为例,告诉我们不懂推荐算法的产品,也能从产品侧出发, 设计出一款不错的推荐系统。 相信很多新手产品,看到算法二字,多是懵圈的。 什么排序算法、最短路径等都是相对传统的算法(注:传统是指科班出身的产品都会接触过)。但对于推荐算法,多数产品对着网上搜到的资源,都会无从下手。特别当某些推荐算法 和 “AI”扯上关系后,更是加大了理解的难度。 但,不了解推荐算法,就无法做推荐系

【前端学习】AntV G6-08 深入图形与图形分组、自定义节点、节点动画(下)

【课程链接】 AntV G6:深入图形与图形分组、自定义节点、节点动画(下)_哔哩哔哩_bilibili 本章十吾老师讲解了一个复杂的自定义节点中,应该怎样去计算和绘制图形,如何给一个图形制作不间断的动画,以及在鼠标事件之后产生动画。(有点难,需要好好理解) <!DOCTYPE html><html><head><meta charset="UTF-8"><title>06

学习hash总结

2014/1/29/   最近刚开始学hash,名字很陌生,但是hash的思想却很熟悉,以前早就做过此类的题,但是不知道这就是hash思想而已,说白了hash就是一个映射,往往灵活利用数组的下标来实现算法,hash的作用:1、判重;2、统计次数;

康拓展开(hash算法中会用到)

康拓展开是一个全排列到一个自然数的双射(也就是某个全排列与某个自然数一一对应) 公式: X=a[n]*(n-1)!+a[n-1]*(n-2)!+...+a[i]*(i-1)!+...+a[1]*0! 其中,a[i]为整数,并且0<=a[i]<i,1<=i<=n。(a[i]在不同应用中的含义不同); 典型应用: 计算当前排列在所有由小到大全排列中的顺序,也就是说求当前排列是第

性能分析之MySQL索引实战案例

文章目录 一、前言二、准备三、MySQL索引优化四、MySQL 索引知识回顾五、总结 一、前言 在上一讲性能工具之 JProfiler 简单登录案例分析实战中已经发现SQL没有建立索引问题,本文将一起从代码层去分析为什么没有建立索引? 开源ERP项目地址:https://gitee.com/jishenghua/JSH_ERP 二、准备 打开IDEA找到登录请求资源路径位置

csu 1446 Problem J Modified LCS (扩展欧几里得算法的简单应用)

这是一道扩展欧几里得算法的简单应用题,这题是在湖南多校训练赛中队友ac的一道题,在比赛之后请教了队友,然后自己把它a掉 这也是自己独自做扩展欧几里得算法的题目 题意:把题意转变下就变成了:求d1*x - d2*y = f2 - f1的解,很明显用exgcd来解 下面介绍一下exgcd的一些知识点:求ax + by = c的解 一、首先求ax + by = gcd(a,b)的解 这个

综合安防管理平台LntonAIServer视频监控汇聚抖动检测算法优势

LntonAIServer视频质量诊断功能中的抖动检测是一个专门针对视频稳定性进行分析的功能。抖动通常是指视频帧之间的不必要运动,这种运动可能是由于摄像机的移动、传输中的错误或编解码问题导致的。抖动检测对于确保视频内容的平滑性和观看体验至关重要。 优势 1. 提高图像质量 - 清晰度提升:减少抖动,提高图像的清晰度和细节表现力,使得监控画面更加真实可信。 - 细节增强:在低光条件下,抖