The Frequent Pattern Tree datastructure used for mining patterns using {@link FPGrowth} algorithm
Пример #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="level"></param>
 /// <returns></returns>
 public FPTree GetTree(int level)
 {
     while (treeCache.Count < level + 1)
     {
         FPTree cTree = new FPTree();
         treeCache.Add(cTree);
     }
     FPTree conditionalTree = treeCache[level];
     conditionalTree.Clear();
     return conditionalTree;
 }
Пример #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="attr"></param>
 /// <returns></returns>
 public FPTree GetFirstLevelTree(int attr)
 {
     FPTree tree = firstLevelCache.Get(attr);
     if (tree != null)
     {
         hits++;
         return tree;
     }
     else
     {
         misses++;
         FPTree conditionalTree = new FPTree();
         firstLevelCache.Set(attr, conditionalTree);
         return conditionalTree;
     }
 }