FP-growth算法在python中的实现,代码亲测可用,如果有
类似:'ascii' codec can't decode byte 0xe8 in position 0 的报错,请修改fpgrowth.py中的CreatFPtree中的下面两种:
orderedItem = [v[0] for v in sorted(localD.iteritems(), key=lambda p:(p[1], -ord(p[0])), reverse=True)]
# orderedItem = [v[0] for v in sorted(localD.iteritems(), key=lambda p:(p[1], int(p[0])), reverse=True)]
1