mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robina...@apache.org
Subject svn commit: r827438 - /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
Date Tue, 20 Oct 2009 13:44:21 GMT
Author: robinanil
Date: Tue Oct 20 13:44:21 2009
New Revision: 827438

URL: http://svn.apache.org/viewvc?rev=827438&view=rev
Log:
Changing MAHOUT FPGrowth:growth for-loop to while-loop 

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java?rev=827438&r1=827437&r2=827438&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
Tue Oct 20 13:44:21 2009
@@ -218,8 +218,8 @@
       outputCollector.collect(attribute, frequentPatterns);
 
       minSupportValue = Math.max(minSupportValue, minSupport.intValue() / 2);
-      log.info("Found {} Patterns with Least Support {}", Patterns
-          .get(attribute).count(), Patterns.get(attribute).leastSupport());
+      log.info("Found {} Patterns with Least Support {}", Patterns.get(
+          attribute).count(), Patterns.get(attribute).leastSupport());
     }
     log.info("Tree Cache: First Level: Cache hits={} Cache Misses={}",
         treeCache.getHits(), treeCache.getMisses());
@@ -321,8 +321,8 @@
         currentAttribute);
     if (i < 0)
       return frequentPatterns;
-
-    for (int j = tree.getHeaderTableCount(); i < j; i++) {
+    int j = tree.getHeaderTableCount();
+    while (i < j) {
       int attribute = tree.getAttributeAtIndex(i);
       long count = tree.getHeaderSupportCount(attribute);
       if (count < minSupportMutable.intValue())
@@ -352,7 +352,7 @@
           minSupportMutable.setValue(frequentPatterns.leastSupport());
         }
       }
-
+      i++;
     }
 
     return frequentPatterns;



Mime
View raw message