def _fpgrowth(fptree, fis, report, min_support=2, pruning=True):
    (_, heads) = fptree
    n = 0
    for (head_node, head_support) in heads.values():
        if head_support < min_support:
            continue

        fis.add(head_node.key)
        report[frozenset(fis)] = head_support
        new_heads = _init_heads(heads)
        _create_cond_tree(head_node, new_heads, pruning)
        if pruning:
            _prune_cond_tree(new_heads, min_support)
        n = n + 1 + _fpgrowth(
            (None, new_heads), fis, report, min_support, pruning)
        fis.remove(head_node.key)
    return n
dataset/ETHPy150Open bartdag/pymining/pymining/itemmining.py/_fpgrowth/original