mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r959784 [1/2] - in /mahout/trunk/core/src: main/java/org/apache/mahout/cf/taste/hadoop/ main/java/org/apache/mahout/cf/taste/hadoop/pseudo/ main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/ main/java/org/apache/mahout/cf/taste/im...
Date Thu, 01 Jul 2010 21:08:27 GMT
Author: srowen
Date: Thu Jul  1 21:08:24 2010
New Revision: 959784

URL: http://svn.apache.org/viewvc?rev=959784&view=rev
Log:
Big attack on checkstyle warnings

Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/TasteHadoopUtils.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/ItemSimilarityJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/MostSimilarItemPairsMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/PrefsToItemUserMatrixReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/SimilarItem.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericItemPreferenceArray.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericUserPreferenceArray.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/BayesFileFormatter.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ConfusionMatrix.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/BayesAlgorithm.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/CBayesAlgorithm.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/BayesParameters.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesFeatureMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyClusterer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/AsymmetricSampledNormalDistribution.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1Model.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1ModelDistribution.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/NormalModelDistribution.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalDistribution.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalModel.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansCombiner.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansCombiner.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyCreatorMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/StringRecordIterator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/cache/LFUCache.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/cache/LeastKCache.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/parameters/Parametered.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/Bagging.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/DFUtils.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/DecisionForest.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/builder/DefaultTreeBuilder.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/data/Data.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/data/DataLoader.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/data/conditions/Condition.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/mapreduce/Classifier.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/mapreduce/partial/Step0Job.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/TransactionTree.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/convertors/TopKPatternsOutputConverter.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FPGrowth.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/FrequentPatternMaxHeap.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/Pattern.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/DistributedRowMatrix.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/MatrixMultiplicationJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/TimesSquaredJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/Cooccurrence.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/RowSimilarityJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/SimilarityMatrixEntryKey.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrence.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedOccurrenceArray.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/WeightedRowPair.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/vector/AbstractDistributedVectorSimilarity.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/similarity/vector/DistributedVectorSimilarity.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/hadoop/similarity/item/ItemSimilarityTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/MockMapperContext.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/MockReducerContext.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/fuzzykmeans/TestFuzzyKmeansClustering.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestMapReduce.java
    mahout/trunk/core/src/test/java/org/apache/mahout/common/MahoutTestCase.java
    mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/Step1MapperTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/MathHelper.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/similarity/TestRowSimilarityJob.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/similarity/vector/DistributedEuclideanDistanceVectorSimilarityTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/similarity/vector/DistributedPearsonCorrelationVectorSimilarityTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/similarity/vector/DistributedTanimotoCoefficientVectorSimilarityTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/similarity/vector/DistributedUncenteredCosineVectorSimilarityTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/similarity/vector/DistributedUncenteredZeroAssumingCosineVectorSimilarityTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/similarity/vector/DistributedVectorSimilarityTestCase.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/TasteHadoopUtils.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/TasteHadoopUtils.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/TasteHadoopUtils.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/TasteHadoopUtils.java Thu Jul  1 21:08:24 2010
@@ -30,6 +30,9 @@ public final class TasteHadoopUtils {
   /** standard delimiter of textual preference data */
   private static final Pattern PREFERENCE_TOKEN_DELIMITER = Pattern.compile("[\t,]");
 
+  private TasteHadoopUtils() {
+  }
+
   /**
    * splits a preference data line into string tokens
    *

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderJob.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderJob.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderJob.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/RecommenderJob.java Thu Jul  1 21:08:24 2010
@@ -20,7 +20,6 @@ package org.apache.mahout.cf.taste.hadoo
 import java.io.IOException;
 import java.util.Map;
 
-import org.apache.commons.cli2.Option;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.NullWritable;
@@ -31,7 +30,6 @@ import org.apache.hadoop.mapreduce.lib.o
 import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.mahout.common.AbstractJob;
-import org.apache.mahout.common.commandline.DefaultOptionCreator;
 import org.apache.mahout.cf.taste.hadoop.RecommendedItemsWritable;
 import org.apache.mahout.math.VarLongWritable;
 

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/ItemSimilarityJob.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/ItemSimilarityJob.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/ItemSimilarityJob.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/ItemSimilarityJob.java Thu Jul  1 21:08:24 2010
@@ -66,7 +66,7 @@ public final class ItemSimilarityJob ext
     addOutputOption();
     addOption("similarityClassname", "s", "Name of distributed similarity class to instantiate");
     addOption("maxSimilaritiesPerItem", "m", "try to cap the number of similar items per item to this number " +
-        "(default: " + DEFAULT_MAX_SIMILAR_ITEMS_PER_ITEM + ")", String.valueOf(DEFAULT_MAX_SIMILAR_ITEMS_PER_ITEM));
+        "(default: " + DEFAULT_MAX_SIMILAR_ITEMS_PER_ITEM + ')', String.valueOf(DEFAULT_MAX_SIMILAR_ITEMS_PER_ITEM));
 
     Map<String,String> parsedArgs = parseArguments(args);
     if (parsedArgs == null) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/MostSimilarItemPairsMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/MostSimilarItemPairsMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/MostSimilarItemPairsMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/MostSimilarItemPairsMapper.java Thu Jul  1 21:08:24 2010
@@ -89,7 +89,7 @@ public class MostSimilarItemPairsMapper
     Iterator<Element> similarityVectorIterator = similarityVector.get().iterateNonZero();
 
     while (similarityVectorIterator.hasNext()) {
-      Vector.Element element = similarityVectorIterator.next();
+      Element element = similarityVectorIterator.next();
       int index = element.index();
       double value = element.get();
       /* ignore self similarities */

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/PrefsToItemUserMatrixReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/PrefsToItemUserMatrixReducer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/PrefsToItemUserMatrixReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/PrefsToItemUserMatrixReducer.java Thu Jul  1 21:08:24 2010
@@ -32,10 +32,10 @@ import org.apache.mahout.math.hadoop.Dis
  * creates matrix rows ({@link VectorWritable}s) from the {@link MatrixEntryWritable}s
  */
 public class PrefsToItemUserMatrixReducer
-    extends Reducer<VarIntWritable,DistributedRowMatrix.MatrixEntryWritable,IntWritable,VectorWritable> {
+    extends Reducer<VarIntWritable, MatrixEntryWritable,IntWritable,VectorWritable> {
 
   @Override
-  protected void reduce(VarIntWritable rowIndex, Iterable<DistributedRowMatrix.MatrixEntryWritable> entries,
+  protected void reduce(VarIntWritable rowIndex, Iterable<MatrixEntryWritable> entries,
       Context ctx) throws IOException, InterruptedException {
     Vector row = new RandomAccessSparseVector(Integer.MAX_VALUE, 100);
     for (MatrixEntryWritable entry : entries) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/SimilarItem.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/SimilarItem.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/SimilarItem.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/similarity/item/SimilarItem.java Thu Jul  1 21:08:24 2010
@@ -23,11 +23,10 @@ class SimilarItem {
 
   static final Comparator<SimilarItem> COMPARE_BY_SIMILARITY = new BySimilaritySimilarItemComparator();
 
-  private long itemID;
-  private double similarity;
+  private final long itemID;
+  private final double similarity;
 
-  public SimilarItem(long itemID, double similarity) {
-    super();
+  SimilarItem(long itemID, double similarity) {
     this.itemID = itemID;
     this.similarity = similarity;
   }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericItemPreferenceArray.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericItemPreferenceArray.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericItemPreferenceArray.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericItemPreferenceArray.java Thu Jul  1 21:08:24 2010
@@ -230,9 +230,7 @@ public final class GenericItemPreference
       return false;
     }
     GenericItemPreferenceArray otherArray = (GenericItemPreferenceArray) other;
-    return id == otherArray.id &&
-        Arrays.equals(ids, otherArray.ids) &&
-        Arrays.equals(values, otherArray.values);
+    return id == otherArray.id && Arrays.equals(ids, otherArray.ids) && Arrays.equals(values, otherArray.values);
   }
   
   @Override

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericUserPreferenceArray.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericUserPreferenceArray.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericUserPreferenceArray.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericUserPreferenceArray.java Thu Jul  1 21:08:24 2010
@@ -231,9 +231,7 @@ public final class GenericUserPreference
       return false;
     }
     GenericUserPreferenceArray otherArray = (GenericUserPreferenceArray) other;
-    return id == otherArray.id &&
-        Arrays.equals(ids, otherArray.ids) &&
-        Arrays.equals(values, otherArray.values);
+    return id == otherArray.id && Arrays.equals(ids, otherArray.ids) && Arrays.equals(values, otherArray.values);
   }
   
   @Override

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/BayesFileFormatter.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/BayesFileFormatter.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/BayesFileFormatter.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/BayesFileFormatter.java Thu Jul  1 21:08:24 2010
@@ -209,7 +209,7 @@ public final class BayesFileFormatter {
       writer.write(label);
       writer.write('\t'); // edit: Inorder to match Hadoop standard
       // TextInputFormat
-      TermAttribute termAtt = (TermAttribute) ts.addAttribute(TermAttribute.class);
+      TermAttribute termAtt = ts.addAttribute(TermAttribute.class);
       while (ts.incrementToken()) {
         char[] termBuffer = termAtt.termBuffer();
         int termLen = termAtt.termLength();

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ConfusionMatrix.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ConfusionMatrix.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ConfusionMatrix.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ConfusionMatrix.java Thu Jul  1 21:08:24 2010
@@ -93,8 +93,7 @@ public class ConfusionMatrix implements 
   }
   
   public int getCount(String correctLabel, String classifiedLabel) {
-    if (labels.contains(correctLabel) &&
-        !(labels.contains(classifiedLabel) || defaultLabel.equals(classifiedLabel))) {
+    if (labels.contains(correctLabel) && !(labels.contains(classifiedLabel) || defaultLabel.equals(classifiedLabel))) {
       throw new IllegalArgumentException("Label not found " + correctLabel + ' ' + classifiedLabel);
     }
     int correctId = labelMap.get(correctLabel);
@@ -103,8 +102,7 @@ public class ConfusionMatrix implements 
   }
   
   public void putCount(String correctLabel, String classifiedLabel, int count) {
-    if (labels.contains(correctLabel) &&
-        !(labels.contains(classifiedLabel) || defaultLabel.equals(classifiedLabel))) {
+    if (labels.contains(correctLabel) && !(labels.contains(classifiedLabel) || defaultLabel.equals(classifiedLabel))) {
       throw new IllegalArgumentException("Label not found " + correctLabel + ' ' + classifiedLabel);
     }
     int correctId = labelMap.get(correctLabel);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/TestClassifier.java Thu Jul  1 21:08:24 2010
@@ -189,7 +189,7 @@ public final class TestClassifier {
     File[] subdirs = dir.listFiles(new FilenameFilter() {
       @Override
       public boolean accept(File file, String s) {
-        return s.startsWith(".") == false;
+        return !s.startsWith(".");
       }
     });
     

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/BayesAlgorithm.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/BayesAlgorithm.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/BayesAlgorithm.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/BayesAlgorithm.java Thu Jul  1 21:08:24 2010
@@ -79,7 +79,7 @@ public class BayesAlgorithm implements A
       return new ClassifierResult[] {new ClassifierResult(defaultCategory, 0.0)};
     } else {
       List<ClassifierResult> result = new ArrayList<ClassifierResult>(pq.size());
-      while (pq.isEmpty() == false) {
+      while (!pq.isEmpty()) {
         result.add(pq.remove());
       }
       Collections.reverse(result);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/CBayesAlgorithm.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/CBayesAlgorithm.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/CBayesAlgorithm.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/CBayesAlgorithm.java Thu Jul  1 21:08:24 2010
@@ -79,7 +79,7 @@ public class CBayesAlgorithm implements 
       return new ClassifierResult[] {new ClassifierResult(defaultCategory, 0.0)};
     } else {
       List<ClassifierResult> result = new ArrayList<ClassifierResult>(pq.size());
-      while (pq.isEmpty() == false) {
+      while (!pq.isEmpty()) {
         result.add(pq.remove());
       }
       Collections.reverse(result);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/BayesParameters.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/BayesParameters.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/BayesParameters.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/BayesParameters.java Thu Jul  1 21:08:24 2010
@@ -25,7 +25,6 @@ import org.apache.mahout.common.Paramete
 public class BayesParameters extends Parameters {
   
   public BayesParameters(int gramSize) {
-    super();
     set("gramSize", Integer.toString(gramSize));
   }
   

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesFeatureMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesFeatureMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesFeatureMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesFeatureMapper.java Thu Jul  1 21:08:24 2010
@@ -82,7 +82,7 @@ public class BayesFeatureMapper extends 
     if (gramSize > 1) {
       ShingleFilter sf = new ShingleFilter(new IteratorTokenStream(new ArrayIterator<String>(tokens)), gramSize);
       do {
-        String term = ((TermAttribute) sf.getAttribute(TermAttribute.class)).term();
+        String term = (sf.getAttribute(TermAttribute.class)).term();
         if (term.length() > 0) {
           if (wordList.containsKey(term)) {
             wordList.put(term, 1 + wordList.get(term));

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyClusterer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyClusterer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyClusterer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyClusterer.java Thu Jul  1 21:08:24 2010
@@ -24,6 +24,7 @@ import java.util.List;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
 import org.apache.mahout.clustering.WeightedVectorWritable;
 import org.apache.mahout.common.distance.DistanceMeasure;
@@ -119,8 +120,9 @@ public class CanopyClusterer {
     numVectors++;
   }
 
-  @SuppressWarnings("unchecked")
-  public void emitPointToClosestCanopy(Vector point, List<Canopy> canopies, org.apache.hadoop.mapreduce.Mapper.Context context)
+  public void emitPointToClosestCanopy(Vector point,
+                                       List<Canopy> canopies,
+                                       Mapper<?,?,IntWritable,WeightedVectorWritable>.Context context)
       throws IOException, InterruptedException {
 
     double minDist = Double.MAX_VALUE;

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyMapper.java Thu Jul  1 21:08:24 2010
@@ -33,26 +33,17 @@ class CanopyMapper extends Mapper<Writab
 
   private CanopyClusterer canopyClusterer;
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
     canopyClusterer.addPointToCanopies(point.get(), canopies, context);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);
     canopyClusterer = new CanopyClusterer(context.getConfiguration());
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#cleanup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void cleanup(Context context) throws IOException, InterruptedException {
     for (Canopy canopy : canopies) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyReducer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/CanopyReducer.java Thu Jul  1 21:08:24 2010
@@ -19,7 +19,6 @@ package org.apache.mahout.clustering.can
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.hadoop.io.Text;
@@ -29,14 +28,10 @@ import org.apache.mahout.math.VectorWrit
 
 public class CanopyReducer extends Reducer<Text, VectorWritable, Text, Canopy> {
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#reduce(java.lang.Object, java.lang.Iterable, org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void reduce(Text arg0, Iterable<VectorWritable> values, Context context) throws IOException, InterruptedException {
-    Iterator<VectorWritable> it = values.iterator();
-    while (it.hasNext()) {
-      Vector point = it.next().get();
+    for (VectorWritable value : values) {
+      Vector point = value.get();
       canopyClusterer.addPointToCanopies(point, canopies, context);
     }
     for (Canopy canopy : canopies) {
@@ -44,9 +39,6 @@ public class CanopyReducer extends Reduc
     }
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#setup(org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/canopy/ClusterMapper.java Thu Jul  1 21:08:24 2010
@@ -38,9 +38,6 @@ public class ClusterMapper extends Mappe
 
   private CanopyClusterer canopyClusterer;
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
     canopyClusterer.emitPointToClosestCanopy(point.get(), canopies, context);
@@ -59,9 +56,6 @@ public class ClusterMapper extends Mappe
     this.canopies.addAll(canopies);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterMapper.java Thu Jul  1 21:08:24 2010
@@ -39,17 +39,11 @@ public class DirichletClusterMapper exte
   private List<DirichletCluster<VectorWritable>> clusters;
   private DirichletClusterer<VectorWritable> clusterer;
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void map(WritableComparable<?> key, VectorWritable vector, Context context) throws IOException, InterruptedException {
     clusterer.emitPointToClusters(vector, clusters, context);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletClusterer.java Thu Jul  1 21:08:24 2010
@@ -237,11 +237,7 @@ public class DirichletClusterer<O> {
 
   /**
    * Emit the point to the most likely cluster
-   * @param point
    * @param pi the normalized pdf Vector for the point
-   * @param output
-   * @throws IOException
-   * @throws InterruptedException 
    */
   private void emitMostLikelyCluster(VectorWritable point, List<DirichletCluster<VectorWritable>> clusters, Vector pi,
       Mapper<WritableComparable<?>, VectorWritable, IntWritable, WeightedVectorWritable>.Context context) throws IOException,

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java Thu Jul  1 21:08:24 2010
@@ -347,7 +347,8 @@ public final class DirichletDriver {
    * @throws InterruptedException 
    * @throws IOException 
    */
-  public static void runClustering(Path input, Path stateIn, Path output, boolean emitMostLikely, double threshold) throws IOException, InterruptedException, ClassNotFoundException {
+  public static void runClustering(Path input, Path stateIn, Path output, boolean emitMostLikely, double threshold)
+    throws IOException, InterruptedException, ClassNotFoundException {
     Configuration conf = new Configuration();
     conf.set(STATE_IN_KEY, stateIn.toString());
     conf.set(EMIT_MOST_LIKELY_KEY, Boolean.toString(emitMostLikely));

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java Thu Jul  1 21:08:24 2010
@@ -37,10 +37,7 @@ import org.apache.mahout.math.function.T
 public class DirichletMapper extends Mapper<WritableComparable<?>,VectorWritable,Text,VectorWritable> {
   
   private DirichletState<VectorWritable> state;
-  
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
+
   @Override
   protected void map(WritableComparable<?> key, VectorWritable v, Context context) throws IOException, InterruptedException {
     // compute a normalized vector of probabilities that v is described by each model
@@ -51,9 +48,6 @@ public class DirichletMapper extends Map
     context.write(new Text(String.valueOf(k)), v);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletReducer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletReducer.java Thu Jul  1 21:08:24 2010
@@ -36,9 +36,6 @@ public class DirichletReducer extends Re
     return newModels;
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#setup(org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);
@@ -58,26 +55,18 @@ public class DirichletReducer extends Re
     this.newModels = state.getModelFactory().sampleFromPosterior(state.getModels());
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#reduce(java.lang.Object, java.lang.Iterable, org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void reduce(Text key, Iterable<VectorWritable> values, Context context) throws IOException, InterruptedException {
     int k = Integer.parseInt(key.toString());
     Model<VectorWritable> model = newModels[k];
-    Iterator<VectorWritable> it = values.iterator();
-    while (it.hasNext()) {
-      VectorWritable v = it.next();
-      model.observe(v);
+    for (VectorWritable value : values) {
+      model.observe(value);
     }
     model.computeParameters();
     DirichletCluster<VectorWritable> cluster = state.getClusters().get(k);
     cluster.setModel(model);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#cleanup(org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void cleanup(Context context) throws IOException, InterruptedException {
     for (int i = 0; i < state.getNumClusters(); i++) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/AsymmetricSampledNormalDistribution.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/AsymmetricSampledNormalDistribution.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/AsymmetricSampledNormalDistribution.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/AsymmetricSampledNormalDistribution.java Thu Jul  1 21:08:24 2010
@@ -29,7 +29,6 @@ import org.apache.mahout.math.VectorWrit
 public class AsymmetricSampledNormalDistribution extends VectorModelDistribution {
   
   public AsymmetricSampledNormalDistribution() {
-    super();
   }
   
   public AsymmetricSampledNormalDistribution(VectorWritable modelPrototype) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1Model.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1Model.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1Model.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1Model.java Thu Jul  1 21:08:24 2010
@@ -112,11 +112,6 @@ public class L1Model implements Model<Ve
     return buf.toString();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see org.apache.mahout.clustering.Printable#asJsonString()
-   */
   @Override
   public String asJsonString() {
     GsonBuilder builder = new GsonBuilder();

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1ModelDistribution.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1ModelDistribution.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1ModelDistribution.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/L1ModelDistribution.java Thu Jul  1 21:08:24 2010
@@ -31,7 +31,6 @@ public class L1ModelDistribution extends
   }
   
   public L1ModelDistribution() {
-    super();
   }
   
   @Override

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/NormalModelDistribution.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/NormalModelDistribution.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/NormalModelDistribution.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/NormalModelDistribution.java Thu Jul  1 21:08:24 2010
@@ -31,7 +31,6 @@ public class NormalModelDistribution ext
   }
   
   public NormalModelDistribution() {
-    super();
   }
   
   @Override

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalDistribution.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalDistribution.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalDistribution.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalDistribution.java Thu Jul  1 21:08:24 2010
@@ -28,7 +28,6 @@ import org.apache.mahout.math.VectorWrit
 public class SampledNormalDistribution extends NormalModelDistribution {
   
   public SampledNormalDistribution() {
-    super();
   }
   
   public SampledNormalDistribution(VectorWritable modelPrototype) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalModel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalModel.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalModel.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/models/SampledNormalModel.java Thu Jul  1 21:08:24 2010
@@ -25,7 +25,6 @@ import org.apache.mahout.math.Vector;
 public class SampledNormalModel extends NormalModel {
   
   public SampledNormalModel() {
-    super();
   }
   
   public SampledNormalModel(int id, Vector mean, double sd) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterMapper.java Thu Jul  1 21:08:24 2010
@@ -35,17 +35,11 @@ public class FuzzyKMeansClusterMapper ex
 
   private FuzzyKMeansClusterer clusterer;
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
     clusterer.emitPointToClusters(point, clusters, context);
-    }
+  }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
      super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansClusterer.java Thu Jul  1 21:08:24 2010
@@ -176,13 +176,6 @@ public class FuzzyKMeansClusterer {
 
   /**
    * Emit the point to the cluster with the highest pdf
-   * 
-   * @param point
-   * @param clusters
-   * @param clusterPdfList
-   * @param output
-   * @throws IOException
-   * @throws InterruptedException 
    */
   static void emitMostLikelyCluster(Vector point, List<SoftCluster> clusters, Vector clusterPdfList,
       Mapper<WritableComparable<?>, VectorWritable, IntWritable, WeightedVectorWritable>.Context context) throws IOException,
@@ -203,13 +196,6 @@ public class FuzzyKMeansClusterer {
 
   /**
    * Emit the point to all clusters
-   * 
-   * @param point
-   * @param clusters
-   * @param pi
-   * @param output
-   * @throws IOException
-   * @throws InterruptedException 
    */
   void emitAllClusters(Vector point, List<SoftCluster> clusters, Vector pi,
       Mapper<WritableComparable<?>, VectorWritable, IntWritable, WeightedVectorWritable>.Context context) throws IOException,

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansCombiner.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansCombiner.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansCombiner.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansCombiner.java Thu Jul  1 21:08:24 2010
@@ -18,7 +18,6 @@
 package org.apache.mahout.clustering.fuzzykmeans;
 
 import java.io.IOException;
-import java.util.Iterator;
 
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Reducer;
@@ -26,31 +25,22 @@ import org.apache.hadoop.mapreduce.Reduc
 public class FuzzyKMeansCombiner extends Reducer<Text,FuzzyKMeansInfo,Text,FuzzyKMeansInfo> {
   
   private FuzzyKMeansClusterer clusterer;
-  
-  
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#reduce(java.lang.Object, java.lang.Iterable, org.apache.hadoop.mapreduce.Reducer.Context)
-   */
+
   @Override
   protected void reduce(Text key, Iterable<FuzzyKMeansInfo> values, Context context) throws IOException, InterruptedException {
     SoftCluster cluster = new SoftCluster(key.toString().trim());
-    Iterator<FuzzyKMeansInfo> it = values.iterator();
-    while (it.hasNext()) {
-      FuzzyKMeansInfo info = it.next();   
-      if (info.getCombinerPass() == 0) { // first time thru combiner
-        cluster.addPoint(info.getVector(), Math.pow(info.getProbability(), clusterer.getM()));
+    for (FuzzyKMeansInfo value : values) {
+      if (value.getCombinerPass() == 0) { // first time thru combiner
+        cluster.addPoint(value.getVector(), Math.pow(value.getProbability(), clusterer.getM()));
       } else {
-        cluster.addPoints(info.getVector(), info.getProbability());
+        cluster.addPoints(value.getVector(), value.getProbability());
       }
-      info.setCombinerPass(info.getCombinerPass() + 1);
+      value.setCombinerPass(value.getCombinerPass() + 1);
     }
     // TODO: how do we pass along the combinerPass? Or do we not need to?
     context.write(key, new FuzzyKMeansInfo(cluster.getPointProbSum(), cluster.getWeightedPointTotal(), 1));
-    }
+  }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#setup(org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansDriver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansDriver.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansDriver.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansDriver.java Thu Jul  1 21:08:24 2010
@@ -179,7 +179,7 @@ public final class FuzzyKMeansDriver {
                             float m,
                             boolean runClustering,
                             boolean emitMostLikely,
-                            double threshold) throws IOException {
+                            double threshold) throws IOException, ClassNotFoundException, InterruptedException {
 
     boolean converged = false;
     int iteration = 1;
@@ -325,7 +325,7 @@ public final class FuzzyKMeansDriver {
                                     int numMapTasks,
                                     float m,
                                     boolean emitMostLikely,
-                                    double threshold) throws IOException {
+                                    double threshold) throws IOException, ClassNotFoundException, InterruptedException {
 
     Configuration conf = new Configuration();
     conf.set(FuzzyKMeansConfigKeys.CLUSTER_PATH_KEY, clustersIn.toString());
@@ -334,6 +334,9 @@ public final class FuzzyKMeansDriver {
     conf.set(FuzzyKMeansConfigKeys.M_KEY, String.valueOf(m));
     conf.set(FuzzyKMeansConfigKeys.EMIT_MOST_LIKELY_KEY, Boolean.toString(emitMostLikely));
     conf.set(FuzzyKMeansConfigKeys.THRESHOLD_KEY, Double.toString(threshold));
+
+    // Clear output
+    output.getFileSystem(conf).delete(output, true);
     
     Job job = new Job(conf);
     job.setOutputKeyClass(IntWritable.class);
@@ -348,17 +351,7 @@ public final class FuzzyKMeansDriver {
     job.setOutputFormatClass(SequenceFileOutputFormat.class);
     //TODO: job.setNumMapTasks(numMapTasks);
     job.setNumReduceTasks(0);
-    try {
-      job.waitForCompletion(true);
-    } catch (IOException e) {
-      log.warn(e.toString(), e);
-    } catch (InterruptedException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    } catch (ClassNotFoundException e) {
-      // TODO Auto-generated catch block
-      e.printStackTrace();
-    }
+    job.waitForCompletion(true);
   }
 
   /**

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansMapper.java Thu Jul  1 21:08:24 2010
@@ -36,19 +36,12 @@ public class FuzzyKMeansMapper extends M
   
   private final List<SoftCluster> clusters = new ArrayList<SoftCluster>();
   private FuzzyKMeansClusterer clusterer;
-  
-  
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
+
   @Override
   protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
     clusterer.emitPointProbToCluster(point.get(), clusters, context);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/fuzzykmeans/FuzzyKMeansReducer.java Thu Jul  1 21:08:24 2010
@@ -20,7 +20,6 @@ package org.apache.mahout.clustering.fuz
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -28,7 +27,6 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Reducer;
-import org.apache.mahout.common.distance.DistanceMeasure;
 
 public class FuzzyKMeansReducer extends Reducer<Text, FuzzyKMeansInfo, Text, SoftCluster> {
 
@@ -36,16 +34,10 @@ public class FuzzyKMeansReducer extends 
 
   private FuzzyKMeansClusterer clusterer;
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#reduce(java.lang.Object, java.lang.Iterable, org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void reduce(Text key, Iterable<FuzzyKMeansInfo> values, Context context) throws IOException, InterruptedException {
     SoftCluster cluster = clusterMap.get(key.toString());
-    Iterator<FuzzyKMeansInfo> it = values.iterator();
-    while (it.hasNext()) {
-      FuzzyKMeansInfo value = it.next();
-
+    for (FuzzyKMeansInfo value : values) {
       if (value.getCombinerPass() == 0) { // escaped from combiner
         cluster.addPoint(value.getVector(), Math.pow(value.getProbability(), clusterer.getM()));
       } else {
@@ -61,9 +53,6 @@ public class FuzzyKMeansReducer extends 
     context.write(new Text(cluster.getIdentifier()), cluster);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#setup(org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java Thu Jul  1 21:08:24 2010
@@ -52,7 +52,6 @@ public class Cluster extends ClusterBase
    *          the center point
    */
   public Cluster(Vector center) {
-    super();
     this.setCenter(new RandomAccessSparseVector(center));
     this.setNumPoints(0);
     this.setPointTotal(getCenter().like());
@@ -69,7 +68,6 @@ public class Cluster extends ClusterBase
    *          the center point
    */
   public Cluster(Vector center, int clusterId) {
-    super();
     this.setId(clusterId);
     this.setCenter(new RandomAccessSparseVector(center));
     this.setNumPoints(0);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterMapper.java Thu Jul  1 21:08:24 2010
@@ -34,19 +34,12 @@ public class KMeansClusterMapper extends
   
   private final List<Cluster> clusters = new ArrayList<Cluster>();
   private KMeansClusterer clusterer;
-  
-  
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
+
   @Override
   protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
     clusterer.outputPointWithClusterInfo(point.get(), clusters, context);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansCombiner.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansCombiner.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansCombiner.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansCombiner.java Thu Jul  1 21:08:24 2010
@@ -17,24 +17,18 @@
 package org.apache.mahout.clustering.kmeans;
 
 import java.io.IOException;
-import java.util.Iterator;
 
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Reducer;
 
 public class KMeansCombiner extends Reducer<Text, KMeansInfo, Text, KMeansInfo> {
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#reduce(java.lang.Object, java.lang.Iterable, org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void reduce(Text key, Iterable<KMeansInfo> values, Context context) throws IOException, InterruptedException {
 
     Cluster cluster = new Cluster(key.toString());
-    Iterator<KMeansInfo> it = values.iterator();
-    while (it.hasNext()) {
-      KMeansInfo next = it.next();
-      cluster.addPoints(next.getPoints(), next.getPointTotal());
+    for (KMeansInfo value : values) {
+      cluster.addPoints(value.getPoints(), value.getPointTotal());
     }
     context.write(key, new KMeansInfo(cluster.getNumPoints(), cluster.getPointTotal()));
   }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java Thu Jul  1 21:08:24 2010
@@ -56,7 +56,8 @@ public final class KMeansDriver {
     Option inputOpt = DefaultOptionCreator.inputOption().create();
     Option clustersOpt = DefaultOptionCreator.clustersInOption().withDescription(
         "The input centroids, as Vectors.  Must be a SequenceFile of Writable, Cluster/Canopy.  "
-            + "If k is also specified, then a random set of vectors will be selected" + " and written out to this path first")
+            + "If k is also specified, then a random set of vectors will be selected"
+            + " and written out to this path first")
         .create();
     Option kOpt = DefaultOptionCreator.kOption().withDescription(
         "The k in k-Means.  If specified, then a random selection of k Vectors will be chosen"
@@ -70,9 +71,10 @@ public final class KMeansDriver {
     Option clusteringOpt = DefaultOptionCreator.clusteringOption().create();
     Option helpOpt = DefaultOptionCreator.helpOption();
 
-    Group group = new GroupBuilder().withName("Options").withOption(inputOpt).withOption(clustersOpt).withOption(outputOpt)
-        .withOption(measureClassOpt).withOption(convergenceDeltaOpt).withOption(maxIterationsOpt).withOption(numReduceTasksOpt)
-        .withOption(kOpt).withOption(overwriteOutput).withOption(helpOpt).withOption(clusteringOpt).create();
+    Group group = new GroupBuilder().withName("Options").withOption(inputOpt).withOption(clustersOpt)
+        .withOption(outputOpt).withOption(measureClassOpt).withOption(convergenceDeltaOpt)
+        .withOption(maxIterationsOpt).withOption(numReduceTasksOpt).withOption(kOpt).withOption(overwriteOutput)
+        .withOption(helpOpt).withOption(clusteringOpt).create();
     try {
       Parser parser = new Parser();
       parser.setGroup(group);
@@ -94,7 +96,8 @@ public final class KMeansDriver {
         HadoopUtil.overwriteOutput(output);
       }
       if (cmdLine.hasOption(kOpt)) {
-        clusters = RandomSeedGenerator.buildRandom(input, clusters, Integer.parseInt(cmdLine.getValue(kOpt).toString()));
+        clusters = RandomSeedGenerator.buildRandom(input, clusters,
+                                                   Integer.parseInt(cmdLine.getValue(kOpt).toString()));
       }
       runJob(input, clusters, output, measureClass, convergenceDelta, maxIterations, numReduceTasks, cmdLine
           .hasOption(clusteringOpt));
@@ -132,9 +135,10 @@ public final class KMeansDriver {
     // iterate until the clusters converge
     String delta = Double.toString(convergenceDelta);
     if (log.isInfoEnabled()) {
-      log.info("Input: {} Clusters In: {} Out: {} Distance: {}", new Object[] { input, clustersIn, output, measureClass });
-      log.info("convergence: {} max Iterations: {} num Reduce Tasks: {} Input Vectors: {}", new Object[] { convergenceDelta,
-          maxIterations, numReduceTasks, VectorWritable.class.getName() });
+      log.info("Input: {} Clusters In: {} Out: {} Distance: {}",
+               new Object[] { input, clustersIn, output, measureClass });
+      log.info("convergence: {} max Iterations: {} num Reduce Tasks: {} Input Vectors: {}",
+               new Object[] { convergenceDelta, maxIterations, numReduceTasks, VectorWritable.class.getName() });
     }
     boolean converged = false;
     int iteration = 1;
@@ -173,8 +177,13 @@ public final class KMeansDriver {
    * @throws ClassNotFoundException 
    * @throws InterruptedException 
    */
-  private static boolean runIteration(Path input, Path clustersIn, Path clustersOut, String measureClass, String convergenceDelta,
-      int numReduceTasks) throws IOException, InterruptedException, ClassNotFoundException {
+  private static boolean runIteration(Path input,
+                                      Path clustersIn,
+                                      Path clustersOut,
+                                      String measureClass,
+                                      String convergenceDelta,
+                                      int numReduceTasks)
+    throws IOException, InterruptedException, ClassNotFoundException {
     Configuration conf = new Configuration();
     conf.set(KMeansConfigKeys.CLUSTER_PATH_KEY, clustersIn.toString());
     conf.set(KMeansConfigKeys.DISTANCE_MEASURE_KEY, measureClass);
@@ -220,11 +229,16 @@ public final class KMeansDriver {
    * @throws ClassNotFoundException 
    * @throws InterruptedException 
    */
-  private static void runClustering(Path input, Path clustersIn, Path output, String measureClass, String convergenceDelta)
-      throws IOException, InterruptedException, ClassNotFoundException {
+  private static void runClustering(Path input,
+                                    Path clustersIn,
+                                    Path output,
+                                    String measureClass,
+                                    String convergenceDelta)
+    throws IOException, InterruptedException, ClassNotFoundException {
     if (log.isInfoEnabled()) {
       log.info("Running Clustering");
-      log.info("Input: {} Clusters In: {} Out: {} Distance: {}", new Object[] { input, clustersIn, output, measureClass });
+      log.info("Input: {} Clusters In: {} Out: {} Distance: {}",
+               new Object[] { input, clustersIn, output, measureClass });
       log.info("convergence: {} Input Vectors: {}", convergenceDelta, VectorWritable.class.getName());
     }
     Configuration conf = new Configuration();
@@ -271,7 +285,7 @@ public final class KMeansDriver {
           Writable key = (Writable) reader.getKeyClass().newInstance();
           Cluster value = new Cluster();
           while (reader.next(key, value)) {
-            if (value.isConverged() == false) {
+            if (!value.isConverged()) {
               return false;
             }
           }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansMapper.java Thu Jul  1 21:08:24 2010
@@ -34,17 +34,12 @@ public class KMeansMapper extends Mapper
 
   private final List<Cluster> clusters = new ArrayList<Cluster>();
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
-  protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
+  protected void map(WritableComparable<?> key, VectorWritable point, Context context)
+    throws IOException, InterruptedException {
     this.clusterer.emitPointToNearestCluster(point.get(), this.clusters, context);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java Thu Jul  1 21:08:24 2010
@@ -19,7 +19,6 @@ package org.apache.mahout.clustering.kme
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -37,15 +36,11 @@ public class KMeansReducer extends Reduc
 
   private DistanceMeasure measure;
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#reduce(java.lang.Object, java.lang.Iterable, org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
-  protected void reduce(Text key, Iterable<KMeansInfo> values, Context context) throws IOException, InterruptedException {
+  protected void reduce(Text key, Iterable<KMeansInfo> values, Context context)
+    throws IOException, InterruptedException {
     Cluster cluster = clusterMap.get(key.toString());
-    Iterator<KMeansInfo> it = values.iterator();
-    while (it.hasNext()) {
-      KMeansInfo delta = it.next();
+    for (KMeansInfo delta : values) {
       cluster.addPoints(delta.getPoints(), delta.getPointTotal());
     }
     // force convergence calculation
@@ -56,9 +51,6 @@ public class KMeansReducer extends Reduc
     context.write(new Text(cluster.getIdentifier()), cluster);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#setup(org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDAMapper.java Thu Jul  1 21:08:24 2010
@@ -43,7 +43,7 @@ public class LDAMapper extends Mapper<Wr
                      VectorWritable wordCountsWritable,
                      Context context) throws IOException, InterruptedException {
     Vector wordCounts = wordCountsWritable.get();
-    LDAInference.InferredDocument doc = null;
+    LDAInference.InferredDocument doc;
     try {
       doc = infer.infer(wordCounts);
     } catch (ArrayIndexOutOfBoundsException e1) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterMapper.java Thu Jul  1 21:08:24 2010
@@ -34,16 +34,14 @@ import org.apache.mahout.clustering.Weig
 import org.apache.mahout.clustering.kmeans.OutputLogFilter;
 import org.apache.mahout.math.VectorWritable;
 
-public class MeanShiftCanopyClusterMapper extends Mapper<WritableComparable<?>, MeanShiftCanopy, IntWritable, WeightedVectorWritable> {
+public class MeanShiftCanopyClusterMapper
+  extends Mapper<WritableComparable<?>, MeanShiftCanopy, IntWritable, WeightedVectorWritable> {
 
   private List<MeanShiftCanopy> canopies;
 
-  
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
-  protected void map(WritableComparable<?> key, MeanShiftCanopy canopy, Context context) throws IOException, InterruptedException {
+  protected void map(WritableComparable<?> key, MeanShiftCanopy canopy, Context context)
+    throws IOException, InterruptedException {
     // canopies use canopyIds assigned when input vectors are processed as vectorIds too
     int vectorId = canopy.getId();
     for (MeanShiftCanopy msc : canopies) {
@@ -56,9 +54,6 @@ public class MeanShiftCanopyClusterMappe
     }
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyClusterer.java Thu Jul  1 21:08:24 2010
@@ -64,8 +64,8 @@ public class MeanShiftCanopyClusterer {
    */
   public void configure(Configuration configuration) {
     try {
-      measure = Class.forName(configuration.get(MeanShiftCanopyConfigKeys.DISTANCE_MEASURE_KEY)).asSubclass(DistanceMeasure.class)
-          .newInstance();
+      measure = Class.forName(configuration.get(MeanShiftCanopyConfigKeys.DISTANCE_MEASURE_KEY))
+          .asSubclass(DistanceMeasure.class).newInstance();
       measure.configure(configuration);
     } catch (ClassNotFoundException e) {
       throw new IllegalStateException(e);
@@ -203,8 +203,10 @@ public class MeanShiftCanopyClusterer {
    * @param numIter
    *          the maximum number of iterations
    */
-  public static List<MeanShiftCanopy> clusterPoints(List<Vector> points, DistanceMeasure measure, double convergenceThreshold,
-      double t1, double t2, int numIter) {
+  public static List<MeanShiftCanopy> clusterPoints(List<Vector> points,
+                                                    DistanceMeasure measure,
+                                                    double convergenceThreshold,
+                                                    double t1, double t2, int numIter) {
     MeanShiftCanopyClusterer clusterer = new MeanShiftCanopyClusterer(measure, t1, t2, convergenceThreshold);
 
     List<MeanShiftCanopy> canopies = new ArrayList<MeanShiftCanopy>();
@@ -227,14 +229,15 @@ public class MeanShiftCanopyClusterer {
    * @param canopies
    *          the List<MeanShiftCanopy> clusters
    */
-  public static boolean runMeanShiftCanopyIteration(List<MeanShiftCanopy> canopies, MeanShiftCanopyClusterer clusterer) {
+  public static boolean runMeanShiftCanopyIteration(List<MeanShiftCanopy> canopies,
+                                                    MeanShiftCanopyClusterer clusterer) {
     boolean converged = true;
     List<MeanShiftCanopy> migratedCanopies = new ArrayList<MeanShiftCanopy>();
     for (MeanShiftCanopy canopy : canopies) {
       converged = clusterer.shiftToMean(canopy) && converged;
       clusterer.mergeCanopy(canopy, migratedCanopies);
     }
-    canopies = migratedCanopies;
+    //canopies = migratedCanopies;
     return converged;
 
   }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyCreatorMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyCreatorMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyCreatorMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyCreatorMapper.java Thu Jul  1 21:08:24 2010
@@ -31,18 +31,12 @@ public class MeanShiftCanopyCreatorMappe
 
   private static int nextCanopyId = -1;
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
     MeanShiftCanopy canopy = new MeanShiftCanopy(point.get(), nextCanopyId++);
     context.write(new Text(key.toString()), canopy);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyDriver.java Thu Jul  1 21:08:24 2010
@@ -67,9 +67,10 @@ public final class MeanShiftCanopyDriver
     Option threshold2Opt = DefaultOptionCreator.t2Option().create();
     Option clusteringOpt = DefaultOptionCreator.clusteringOption().create();
 
-    Group group = new GroupBuilder().withName("Options").withOption(inputOpt).withOption(outputOpt).withOption(overwriteOutput)
-        .withOption(measureClassOpt).withOption(helpOpt).withOption(convergenceDeltaOpt).withOption(threshold1Opt).withOption(
-            threshold2Opt).withOption(clusteringOpt).withOption(maxIterOpt).withOption(inputIsCanopiesOpt).create();
+    Group group = new GroupBuilder().withName("Options").withOption(inputOpt).withOption(outputOpt)
+        .withOption(overwriteOutput).withOption(measureClassOpt).withOption(helpOpt)
+        .withOption(convergenceDeltaOpt).withOption(threshold1Opt).withOption(threshold2Opt)
+        .withOption(clusteringOpt).withOption(maxIterOpt).withOption(inputIsCanopiesOpt).create();
 
     try {
       Parser parser = new Parser();
@@ -91,8 +92,8 @@ public final class MeanShiftCanopyDriver
       double t2 = Double.parseDouble(cmdLine.getValue(threshold2Opt).toString());
       double convergenceDelta = Double.parseDouble(cmdLine.getValue(convergenceDeltaOpt).toString());
       int maxIterations = Integer.parseInt(cmdLine.getValue(maxIterOpt).toString());
-      runJob(input, output, measureClass, t1, t2, convergenceDelta, maxIterations, cmdLine.hasOption(inputIsCanopiesOpt), cmdLine
-          .hasOption(clusteringOpt));
+      runJob(input, output, measureClass, t1, t2, convergenceDelta, maxIterations,
+             cmdLine.hasOption(inputIsCanopiesOpt), cmdLine.hasOption(clusteringOpt));
     } catch (OptionException e) {
       log.error("Exception parsing command line: ", e);
       CommandLineUtil.printHelp(group);
@@ -147,7 +148,8 @@ public final class MeanShiftCanopyDriver
     job.waitForCompletion(true);
   }
 
-  static void createCanopyFromVectors(Path input, Path output) throws IOException, InterruptedException, ClassNotFoundException {
+  static void createCanopyFromVectors(Path input, Path output)
+    throws IOException, InterruptedException, ClassNotFoundException {
     Configuration conf = new Configuration();
     Job job = new Job(conf);
     job.setOutputKeyClass(Text.class);
@@ -176,8 +178,8 @@ public final class MeanShiftCanopyDriver
    * @throws InterruptedException 
    * @throws IOException 
    */
-  static void runClustering(Path input, Path clustersIn, Path output) throws IOException, InterruptedException,
-      ClassNotFoundException {
+  static void runClustering(Path input, Path clustersIn, Path output)
+    throws IOException, InterruptedException, ClassNotFoundException {
 
     Configuration conf = new Configuration();
     conf.set(STATE_IN_KEY, clustersIn.toString());
@@ -221,9 +223,16 @@ public final class MeanShiftCanopyDriver
    * @throws ClassNotFoundException 
    * @throws InterruptedException 
    */
-  public static void runJob(Path input, Path output, String measureClassName, double t1, double t2, double convergenceDelta,
-      int maxIterations, boolean inputIsCanopies, boolean runClustering) throws IOException, InterruptedException,
-      ClassNotFoundException {
+  public static void runJob(Path input,
+                            Path output,
+                            String measureClassName,
+                            double t1,
+                            double t2,
+                            double convergenceDelta,
+                            int maxIterations,
+                            boolean inputIsCanopies,
+                            boolean runClustering)
+    throws IOException, InterruptedException, ClassNotFoundException {
     Path clustersIn = new Path(output, Cluster.INITIAL_CLUSTERS_DIR);
     if (inputIsCanopies) {
       clustersIn = input;

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyMapper.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyMapper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyMapper.java Thu Jul  1 21:08:24 2010
@@ -30,26 +30,19 @@ public class MeanShiftCanopyMapper exten
   private final List<MeanShiftCanopy> canopies = new ArrayList<MeanShiftCanopy>();
   
   private MeanShiftCanopyClusterer clusterer;
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#setup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
+
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);
     clusterer = new MeanShiftCanopyClusterer(context.getConfiguration());
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
-  protected void map(WritableComparable<?> key, MeanShiftCanopy canopy, Context context) throws IOException, InterruptedException {
+  protected void map(WritableComparable<?> key, MeanShiftCanopy canopy, Context context)
+    throws IOException, InterruptedException {
     clusterer.mergeCanopy(canopy.shallowCopy(), canopies);
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Mapper#cleanup(org.apache.hadoop.mapreduce.Mapper.Context)
-   */
   @Override
   protected void cleanup(Context context) throws IOException, InterruptedException {
     for (MeanShiftCanopy canopy : canopies) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyReducer.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/clustering/meanshift/MeanShiftCanopyReducer.java Thu Jul  1 21:08:24 2010
@@ -19,7 +19,6 @@ package org.apache.mahout.clustering.mea
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.hadoop.conf.Configuration;
@@ -33,25 +32,18 @@ public class MeanShiftCanopyReducer exte
   private final List<MeanShiftCanopy> canopies = new ArrayList<MeanShiftCanopy>();
   private MeanShiftCanopyClusterer clusterer;
   private boolean allConverged = true;
-  
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#setup(org.apache.hadoop.mapreduce.Reducer.Context)
-   */
+
   @Override
   protected void setup(Context context) throws IOException, InterruptedException {
     super.setup(context);
     clusterer = new MeanShiftCanopyClusterer(context.getConfiguration());
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#reduce(java.lang.Object, java.lang.Iterable, org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
-  protected void reduce(Text key, Iterable<MeanShiftCanopy> values, Context context) throws IOException, InterruptedException {
-    Iterator<MeanShiftCanopy> it = values.iterator();
-    while (it.hasNext()) {
-      MeanShiftCanopy canopy = it.next();
-      clusterer.mergeCanopy(canopy.shallowCopy(), canopies);
+  protected void reduce(Text key, Iterable<MeanShiftCanopy> values, Context context)
+    throws IOException, InterruptedException {
+    for (MeanShiftCanopy value : values) {
+      clusterer.mergeCanopy(value.shallowCopy(), canopies);
     }
     
     for (MeanShiftCanopy canopy : canopies) {
@@ -65,9 +57,6 @@ public class MeanShiftCanopyReducer exte
     
   }
 
-  /* (non-Javadoc)
-   * @see org.apache.hadoop.mapreduce.Reducer#cleanup(org.apache.hadoop.mapreduce.Reducer.Context)
-   */
   @Override
   protected void cleanup(Context context) throws IOException, InterruptedException {
     Configuration conf = context.getConfiguration();

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java Thu Jul  1 21:08:24 2010
@@ -37,15 +37,15 @@ public final class RandomUtils {
   /** The largest prime less than 2<sup>31</sup>-1 that is the smaller of a twin prime pair. */
   public static final int MAX_INT_SMALLER_TWIN_PRIME = 2147482949;
 
-  private static final Map<RandomWrapper,Boolean> instances =
+  private static final Map<RandomWrapper,Boolean> INSTANCES =
       Collections.synchronizedMap(new WeakHashMap<RandomWrapper,Boolean>());
   
   private RandomUtils() { }
   
   public static void useTestSeed() {
     RandomWrapper.useTestSeed();
-    synchronized (instances) {
-      for (RandomWrapper rng : instances.keySet()) {
+    synchronized (INSTANCES) {
+      for (RandomWrapper rng : INSTANCES.keySet()) {
         rng.reset();
       }
     }
@@ -53,13 +53,13 @@ public final class RandomUtils {
   
   public static Random getRandom() {
     RandomWrapper random = new RandomWrapper();
-    instances.put(random, Boolean.TRUE);
+    INSTANCES.put(random, Boolean.TRUE);
     return random;
   }
   
   public static Random getRandom(long seed) {
     RandomWrapper random = new RandomWrapper(seed);
-    instances.put(random, Boolean.TRUE);
+    INSTANCES.put(random, Boolean.TRUE);
     return random;
   }
   

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/common/StringRecordIterator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/common/StringRecordIterator.java?rev=959784&r1=959783&r2=959784&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/common/StringRecordIterator.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/common/StringRecordIterator.java Thu Jul  1 21:08:24 2010
@@ -27,7 +27,7 @@ public class StringRecordIterator implem
   private static final Long ONE = 1L;
   
   private final Iterator<String> lineIterator;
-  private Pattern splitter;
+  private final Pattern splitter;
   
   public StringRecordIterator(FileLineIterable iterable, String pattern) {
     this.lineIterator = iterable.iterator();



Mime
View raw message