Fp-Growth算法实现
实现上次博客例子,设置最小支持度计数为3,3/5=0.6,所以支持度为0.6
代码
# 属于太菜了,做个调包侠
from mlxtend.preprocessing import..., 'a','m','p'],
['f', 'c', 'a','b','m'],
['f', 'b'],
['c', 'b', 'p'],
['f','c', 'a',...transform(dataset)
df = pd.DataFrame(te_ary, columns=te.columns_)
# 应用 FP-Growth 算法
# min_support 参数指定支持度的阈值...7 0.6 (p, c)
8 0.6 (m, c)
9 0.6 (m, f)
10 0.6 (m, f, c)
11 0.6 (m, a)
12 0.6 (a, c)
13 0.6 (a..., f)
14 0.6 (m, a, c)
15 0.6 (m, a, f)
16 0.6 (f, a, c)
17 0.6 (f, m, a, c)