private ConditionalFPTree CreateConditionalFPTree(uint item, IFPTree fpTree) { ConditionalFPTree cTree = new ConditionalFPTree(item, fpTree.Itemset.Items); foreach (FPTreePrefixPathItem pathItem in fpTree.GetItemPrefixPath(item)) { cTree.Support += pathItem.FPTreeNode.Support; cTree.AddTransaction(pathItem.FPTreeNode.ParentNode, pathItem.FPTreeNode.Support); } // cTree.RemoveInfrequentItems(_options.MinSupport); return(cTree); }
private void MinePatternsFromFpTreeRecursive(IFPTree fpTree) { foreach (var item in fpTree.Items.OrderByDescending(item => item)) { ConditionalFPTree cTree = CreateConditionalFPTree(item, fpTree); if (cTree.Support >= _options.MinSupport) { _frequentItemset.Add(cTree.Itemset); // Recursion MinePatternsFromFpTreeRecursive(cTree); } } }