[英]Recursion in FP-Growth Algorithm
I am trying to implement FP-Growth (frequent pattern mining) algorithm in Java.我正在尝试在 Java 中实现 FP-Growth(频繁模式挖掘)算法。 I have built the tree, but have difficulties with conditional FP tree construction;我已经构建了树,但是在条件 FP 树构建时遇到了困难; I do not understand what recursive function should do.我不明白递归 function 应该做什么。 Given a list of frequent items (in increasing order of frequency counts) - a header, and a tree (list of Node class instances) what steps should the function take?给定一个频繁项列表(按频率计数递增的顺序) - header 和一个树(节点 class 实例列表)function 应该采取哪些步骤?
I have hard time understanding this pseudocode above.我很难理解上面的这个伪代码。 Are alpha and Betha nodes in the Tree, and what do generate and construct functions do?树中的 alpha 和 Betha 节点是什么,生成和构造函数有什么作用? I can do FP-Growth by hand, but find the implementation extremely confusing.我可以手动进行 FP-Growth,但发现实现非常混乱。 If that could help, I can share my code for FP-Tree generation.如果这有帮助,我可以分享我的 FP-Tree 生成代码。 Thanks in advance.提前致谢。
an example of the construct function (bottom up way) would be something like:构造 function (自下而上)的示例如下:
function construct(Tree, anItem)
conditional_pattern_base = empty list
in Tree find all nodes with tag = anItem
for each node found:
support = node.support
conditional_pattern = empty list
while node.parent != root_node
conditional_pattern.append(node.parent)
node = node.parent
conditional_pattern_base.append( (conditional_pattern, support))
return conditional_pattern_base
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.