mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r949271 [5/5] - in /mahout/trunk: buildtools/src/main/resources/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/pseudo/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/si...
Date Fri, 28 May 2010 20:03:40 GMT
Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/OutputDriver.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/OutputDriver.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/OutputDriver.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/OutputDriver.java
Fri May 28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -38,8 +38,8 @@ import org.apache.mahout.common.commandl
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class OutputDriver {
-  /** Logger for this class. */
+public final class OutputDriver {
+
   private static final Logger LOG = LoggerFactory.getLogger(OutputDriver.class);
   
   private OutputDriver() { }

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapred/BuildForest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapred/BuildForest.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapred/BuildForest.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapred/BuildForest.java Fri May
28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -65,7 +65,7 @@ public class BuildForest extends Configu
   
   private int nbTrees; // Number of trees to grow
   
-  private Long seed = null; // Random seed
+  private Long seed; // Random seed
   
   private boolean isPartial; // use partial data implementation
   

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapreduce/BuildForest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapreduce/BuildForest.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapreduce/BuildForest.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapreduce/BuildForest.java Fri
May 28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -66,7 +66,7 @@ public class BuildForest extends Configu
   
   private int nbTrees; // Number of trees to grow
   
-  private Long seed = null; // Random seed
+  private Long seed; // Random seed
   
   private boolean isPartial; // use partial data implementation
   

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapreduce/TestForest.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapreduce/TestForest.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapreduce/TestForest.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/df/mapreduce/TestForest.java Fri
May 28 20:03:36 2010
@@ -206,7 +206,7 @@ public class TestForest extends Configur
     long time = System.currentTimeMillis();
 
     Random rng = RandomUtils.getRandom();
-    ResultAnalyzer analyzer = (analyze) ? new ResultAnalyzer(Arrays.asList(dataset.labels()),
"unknown") : null;
+    ResultAnalyzer analyzer = analyze ? new ResultAnalyzer(Arrays.asList(dataset.labels()),
"unknown") : null;
 
     if (dataFS.getFileStatus(dataPath).isDir()) {
       //the input is a directory of files
@@ -230,7 +230,7 @@ public class TestForest extends Configur
 
     for (Path path : infiles) {
       log.info("Classifying : " + path);
-      Path outfile = (outPath != null) ? new Path(outPath, path.getName()).suffix(".out"):
null;
+      Path outfile = (outPath != null) ? new Path(outPath, path.getName()).suffix(".out")
: null;
       testFile(path, outfile, converter, forest, dataset, analyzer, rng);
     }
   }
@@ -262,7 +262,8 @@ public class TestForest extends Configur
       }
 
       if (analyze) {
-        analyzer.addInstance(dataset.getLabel(instance.label), new ClassifierResult(dataset.getLabel(prediction),
1.0));
+        analyzer.addInstance(dataset.getLabel(instance.getLabel()),
+                             new ClassifierResult(dataset.getLabel(prediction), 1.0));
       }
     }
 
@@ -270,10 +271,6 @@ public class TestForest extends Configur
     input.close();
   }
 
-  /**
-   * @param args
-   * @throws Exception
-   */
   public static void main(String[] args) throws Exception {
     ToolRunner.run(new Configuration(), new TestForest(), args);
   }

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleCombiner.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleCombiner.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleCombiner.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleCombiner.java
Fri May 28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -19,6 +19,7 @@ package org.apache.mahout.fpm.pfpgrowth.
 
 import java.io.IOException;
 import java.util.HashSet;
+import java.util.Set;
 
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Reducer;
@@ -27,9 +28,10 @@ import org.apache.mahout.common.StringTu
 public class KeyBasedStringTupleCombiner extends Reducer<Text,StringTuple,Text,StringTuple>
{
   
   @Override
-  protected void reduce(Text key, Iterable<StringTuple> values, Context context) throws
IOException,
-                                                                                InterruptedException
{
-    HashSet<String> outputValues = new HashSet<String>();
+  protected void reduce(Text key,
+                        Iterable<StringTuple> values,
+                        Context context) throws IOException, InterruptedException {
+    Set<String> outputValues = new HashSet<String>();
     for (StringTuple value : values) {
       outputValues.addAll(value.getEntries());
     }

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleGrouper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleGrouper.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleGrouper.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleGrouper.java
Fri May 28 20:03:36 2010
@@ -1,21 +1,4 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -37,7 +20,6 @@ package org.apache.mahout.fpm.pfpgrowth.
 import java.io.IOException;
 
 import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Job;
@@ -49,7 +31,7 @@ import org.apache.mahout.common.HadoopUt
 import org.apache.mahout.common.Parameters;
 import org.apache.mahout.common.StringTuple;
 
-public class KeyBasedStringTupleGrouper {
+public final class KeyBasedStringTupleGrouper {
   
   private KeyBasedStringTupleGrouper() { }
   

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java Fri May
28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -68,7 +68,7 @@ import org.uncommons.watchmaker.framewor
  * 
  * </ul>
  */
-public class CDGA {
+public final class CDGA {
   
   private static final Logger log = LoggerFactory.getLogger(CDGA.class);
   

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/FileInfoParser.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/FileInfoParser.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/FileInfoParser.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/FileInfoParser.java
Fri May 28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -42,7 +42,7 @@ import org.apache.hadoop.fs.Path;
  * if the attribute is numerical, and its min and max values</li>
  * </ul>
  */
-public class FileInfoParser {
+public final class FileInfoParser {
   
   public static final String IGNORED_TOKEN = "IGNORED";
   

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java
Fri May 28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -62,9 +62,12 @@ public class CDMahoutEvaluator {
    * @param split DatasetSplit used to separate training and testing input
    * @throws IOException
    */
-  public static void evaluate(List<? extends Rule> rules, int target,
-                              Path inpath, Path output, List<CDFitness> evaluations,
DatasetSplit split)
-  throws IOException {
+  public static void evaluate(List<? extends Rule> rules,
+                              int target,
+                              Path inpath,
+                              Path output,
+                              List<CDFitness> evaluations,
+                              DatasetSplit split) throws IOException {
     JobConf conf = new JobConf(CDMahoutEvaluator.class);
     FileSystem fs = FileSystem.get(inpath.toUri(), conf);
     

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosTool.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosTool.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosTool.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosTool.java
Fri May 28 20:03:36 2010
@@ -59,7 +59,7 @@ import org.slf4j.LoggerFactory;
  * Gathers additional information about a given dataset. Takes a descriptor
  * about the attributes, and generates a description for each one.
  */
-public class CDInfosTool {
+public final class CDInfosTool {
   
   private static final Logger log = LoggerFactory.getLogger(CDInfosTool.class);
   
@@ -152,11 +152,8 @@ public class CDInfosTool {
    * Load the dataset's attributes descriptors from an .info file
    * 
    * @param inpath dataset path
-   * @return
-   * @throws IOException
    */
-  private static Descriptors loadDescriptors(FileSystem fs, Path inpath)
-  throws IOException {
+  private static Descriptors loadDescriptors(FileSystem fs, Path inpath) throws IOException
{
     // TODO should become part of FileInfoParser
     
     Path infpath = FileInfoParser.getInfoFile(fs, inpath);

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtils.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtils.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtils.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtils.java
Fri May 28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -23,7 +23,7 @@ import java.util.StringTokenizer;
 /**
  * Utility functions to handle Attribute's description strings.
  */
-public class DescriptionUtils {
+public final class DescriptionUtils {
   private DescriptionUtils() {
   }
   

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/TravellingSalesman.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/TravellingSalesman.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/TravellingSalesman.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/TravellingSalesman.java
Fri May 28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -95,7 +95,7 @@ public final class TravellingSalesman ex
   private SwingBackgroundTask<List<String>> createTask(final Collection<String>
cities) {
     final TravellingSalesmanStrategy strategy = strategyPanel.getStrategy();
     return new SwingBackgroundTask<List<String>>() {
-      private long elapsedTime = 0;
+      private long elapsedTime ;
       
       @Override
       protected List<String> performTask() {

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/text/WikipediaMapper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/text/WikipediaMapper.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/text/WikipediaMapper.java (original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/text/WikipediaMapper.java Fri May
28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -55,7 +55,10 @@ public class WikipediaMapper extends Map
   private boolean all;
   
   @Override
-  public void map(LongWritable key, Text value, OutputCollector<Text,Text> output,
Reporter reporter) throws IOException {
+  public void map(LongWritable key,
+                  Text value,
+                  OutputCollector<Text,Text> output,
+                  Reporter reporter) throws IOException {
     
     String content = value.toString();
     if (content.contains(REDIRECT)) {

Modified: mahout/trunk/examples/src/main/java/org/apache/mahout/text/WikipediaToSequenceFile.java
URL: http://svn.apache.org/viewvc/mahout/trunk/examples/src/main/java/org/apache/mahout/text/WikipediaToSequenceFile.java?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/examples/src/main/java/org/apache/mahout/text/WikipediaToSequenceFile.java
(original)
+++ mahout/trunk/examples/src/main/java/org/apache/mahout/text/WikipediaToSequenceFile.java
Fri May 28 20:03:36 2010
@@ -1,4 +1,4 @@
-/**
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -30,7 +30,6 @@ import org.apache.commons.cli2.builder.A
 import org.apache.commons.cli2.builder.DefaultOptionBuilder;
 import org.apache.commons.cli2.builder.GroupBuilder;
 import org.apache.commons.cli2.commandline.Parser;
-import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.DefaultStringifier;
 import org.apache.hadoop.io.Text;

Modified: mahout/trunk/maven/src/main/resources/mahout-checkstyle.xml
URL: http://svn.apache.org/viewvc/mahout/trunk/maven/src/main/resources/mahout-checkstyle.xml?rev=949271&r1=949270&r2=949271&view=diff
==============================================================================
--- mahout/trunk/maven/src/main/resources/mahout-checkstyle.xml (original)
+++ mahout/trunk/maven/src/main/resources/mahout-checkstyle.xml Fri May 28 20:03:36 2010
@@ -63,7 +63,7 @@
 		<module name="MethodName" />
 		<module name="PackageName" />
 		<module name="ParameterName" />
-		<module name="StaticVariableName" />
+		<!--module name="StaticVariableName" /-->
 		<module name="TypeName" />
 
 		<!-- Header checks -->
@@ -80,7 +80,7 @@
 		<module name="IllegalImport" />    <!-- defaults to sun.* packages -->
 		<module name="RedundantImport" />
 		<module name="UnusedImports" />
-		<module name="ImportOrder"/>
+		<!--module name="ImportOrder"/-->
 
 		<!-- Checks for Size Violations.                    -->
 		<!-- See http://checkstyle.sf.net/config_sizes.html -->
@@ -101,7 +101,7 @@
 			<property name="countEmpty" value="false" />
 		</module>
 		<module name="ParameterNumber">
-			<property name="max" value="7" />
+			<property name="max" value="10" />
 		</module>
 
 		<!-- Checks for whitespace                               -->
@@ -177,7 +177,7 @@
 		<module name="NestedTryDepth">
 			<property name="max" value="3" />
 		</module>
-		<module name="SuperClone" />
+		<!--module name="SuperClone" /-->
 		<module name="SuperFinalize" />
 		<!--<module name="IllegalCatch"/>-->
 		<module name="IllegalThrows">
@@ -186,7 +186,7 @@
 		</module>
 		<!--<module name="RedundantThrows"/>-->
 		<module name="PackageDeclaration" />
-		<module name="JUnitTestCase" />
+		<!--module name="JUnitTestCase" /-->
 		<module name="ReturnCount">
 			<property name="max" value="6" />
 		</module>



Mime
View raw message