mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1134456 [1/6] - in /mahout/trunk: core/src/main/java/org/apache/mahout/cf/taste/common/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/ core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ core/src/main/java/org/apache/mahout/cf...
Date Fri, 10 Jun 2011 21:58:23 GMT
Author: ssc
Date: Fri Jun 10 21:58:14 2011
New Revision: 1134456

URL: http://svn.apache.org/viewvc?rev=1134456&view=rev
Log:
MAHOUT-729 Refactoring: Use Maps.newHashMap() and Lists.newArrayList() from Guava globally

Added:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/DatasetSplitter.java
      - copied, changed from r1134267, mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/DatasetSplitter.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/InMemoryFactorizationEvaluator.java
      - copied, changed from r1134267, mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/InMemoryFactorizationEvaluator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/ParallelFactorizationEvaluator.java
      - copied, changed from r1134267, mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/AbstractBayesAlgorithm.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/Algorithm.java
      - copied, changed from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/interfaces/Algorithm.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/BayesAlgorithm.java
      - copied, changed from r1134267, 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/BayesParameters.java
      - copied, changed from r1134267, 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/ByScoreLabelResultComparator.java
      - copied, changed from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/ByScoreLabelResultComparator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/CBayesAlgorithm.java
      - copied, changed from r1134267, 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/ClassifierContext.java
      - copied, changed from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/model/ClassifierContext.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/Datastore.java
      - copied, changed from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/interfaces/Datastore.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/InMemoryBayesDatastore.java
      - copied, changed from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/datastore/InMemoryBayesDatastore.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/InvalidDatastoreException.java
      - copied, changed from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/exceptions/InvalidDatastoreException.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/SequenceFileModelReader.java   (contents, props changed)
      - copied, changed from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/io/SequenceFileModelReader.java
Removed:
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/datastore/
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/exceptions/
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/interfaces/
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/io/
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/model/
    mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/
Modified:
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/FixedSizePriorityQueue.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommendedItemsWritable.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ItemFilterAsVectorAndPrefsReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ToVectorAndPrefReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RefreshHelper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/LoadEvaluator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericDataModel.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/RandomRecommender.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TopItems.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ALSWRFactorizer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVDFactorizer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/AbstractSimilarity.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/BayesFileFormatter.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ClassifierResult.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/Classify.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/TrainClassifier.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/bayes/BayesClassifierDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/bayes/BayesClassifierMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/bayes/BayesDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/bayes/BayesThetaNormalizerDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/bayes/BayesThetaNormalizerMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/cbayes/CBayesDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/cbayes/CBayesThetaNormalizerDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/cbayes/CBayesThetaNormalizerMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesFeatureDriver.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/classifier/bayes/mapreduce/common/BayesFeatureReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesTfIdfDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesTfIdfMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/BayesWeightSummerDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/mapreduce/common/JobExecutor.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/package-info.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/evaluation/Auc.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/naivebayes/trainer/NaiveBayesSumReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/naivebayes/trainer/NaiveBayesTrainer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/sequencelearning/hmm/HmmAlgorithms.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/sequencelearning/hmm/HmmEvaluator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/sequencelearning/hmm/HmmModel.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/sequencelearning/hmm/HmmTrainer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/classifier/sequencelearning/hmm/HmmUtils.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/ClusterClassifier.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/CanopyDriver.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/DirichletState.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/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/fuzzykmeans/FuzzyKMeansUtil.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/KMeansClusterer.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/kmeans/KMeansUtil.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDADriver.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/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/clustering/minhash/MinHashDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/minhash/MinHashReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/spectral/eigencuts/EigencutsDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/clustering/spectral/eigencuts/EigencutsSensitivityMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/IOUtils.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/IntegerTuple.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/Parameters.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/StringTuple.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/MahalanobisDistanceMeasure.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/MinkowskiDistanceMeasure.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/distance/WeightedDistanceMeasure.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/iterator/FixedSizeSamplingIterator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/iterator/StableFixedSizeSamplingIterator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/common/nlp/NGrams.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/DecisionForest.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/DataUtils.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/data/DescriptorUtils.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/mapreduce/inmem/InMemBuilder.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/mapreduce/inmem/InMemInputFormat.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/mapreduce/partial/Step0Job.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/mapreduce/partial/Step1Mapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/ref/SequentialBuilder.java
    mahout/trunk/core/src/main/java/org/apache/mahout/df/tools/Describe.java
    mahout/trunk/core/src/main/java/org/apache/mahout/driver/MahoutDriver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/AggregatorMapper.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/PFPGrowth.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/ParallelFPGrowthReducer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/TransactionSortingMapper.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/TransactionTreeIterator.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/convertors/integer/IntegerStringOutputConverter.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/convertors/string/TopKStringPatterns.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/FPTreeDepthCache.java
    mahout/trunk/core/src/main/java/org/apache/mahout/fpm/pfpgrowth/fpgrowth/LeastKCache.java
    mahout/trunk/core/src/main/java/org/apache/mahout/ga/watchmaker/OutputUtils.java
    mahout/trunk/core/src/main/java/org/apache/mahout/ga/watchmaker/STEvolutionEngine.java
    mahout/trunk/core/src/main/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluator.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/decomposer/EigenVerificationJob.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/stochasticsvd/BtJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/GivensThinSolver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/QJob.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/SSVDPrototype.java
    mahout/trunk/core/src/main/java/org/apache/mahout/math/hadoop/stochasticsvd/SSVDSolver.java
    mahout/trunk/core/src/main/java/org/apache/mahout/vectorizer/DictionaryVectorizer.java
    mahout/trunk/core/src/main/java/org/apache/mahout/vectorizer/encoders/Dictionary.java
    mahout/trunk/core/src/main/java/org/apache/mahout/vectorizer/encoders/TextValueEncoder.java
    mahout/trunk/core/src/main/java/org/apache/mahout/vectorizer/tfidf/TFIDFConverter.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJobTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/hadoop/item/RecommenderJobTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/TasteTestCase.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastMapTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommenderTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/PreferredItemsNeighborhoodCandidateItemsStrategyTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/SamplingCandidateItemsStrategyTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/similarity/GenericItemSimilarityTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/BayesClassifierSelfTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/BayesClassifierTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/BayesFeatureMapReduceTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/BayesFeatureMapperTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/classifier/bayes/CBayesClassifierTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/TestClusterClassifier.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/TestGaussianAccumulators.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/canopy/TestCanopyCreation.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDirichletClustering.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestMapReduce.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/kmeans/TestRandomSeedGenerator.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/meanshift/TestMeanShift.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/minhash/TestMinHashClustering.java
    mahout/trunk/core/src/test/java/org/apache/mahout/clustering/spectral/eigencuts/TestEigencutsAffinityCutsJob.java
    mahout/trunk/core/src/test/java/org/apache/mahout/common/AbstractJobTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/common/DummyOutputCollector.java
    mahout/trunk/core/src/test/java/org/apache/mahout/common/DummyRecordWriter.java
    mahout/trunk/core/src/test/java/org/apache/mahout/common/DummyStatusReporter.java
    mahout/trunk/core/src/test/java/org/apache/mahout/df/builder/InfiniteRecursionTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/df/data/DataLoaderTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/df/data/DataTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/PartialBuilderTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/PartialSequentialBuilder.java
    mahout/trunk/core/src/test/java/org/apache/mahout/df/mapreduce/partial/Step0JobTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/fpm/pfpgrowth/FPGrowthRetailDataTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/fpm/pfpgrowth/FPGrowthTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/fpm/pfpgrowth/PFPGrowthRetailDataTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/fpm/pfpgrowth/PFPGrowthTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/fpm/pfpgrowth/TransactionTreeTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/MahoutEvaluatorTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java
    mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyCandidate.java
    mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.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/TestDistributedRowMatrix.java
    mahout/trunk/core/src/test/java/org/apache/mahout/math/hadoop/decomposer/TestDistributedLanczosSolverCLI.java
    mahout/trunk/core/src/test/java/org/apache/mahout/vectorizer/collocations/llr/GramTest.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/bookcrossing/BookCrossingDataModel.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/grouplens/GroupLensDataModel.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/jester/JesterDataModel.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/kddcup/track1/Track1RecommenderEvaluator.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/kddcup/track1/Track1Runner.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/kddcup/track1/svd/DataModelFactorizablePreferences.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/kddcup/track2/Track2Callable.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/kddcup/track2/Track2Runner.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/netflix/NetflixDataModel.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/netflix/NetflixFileDataModel.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/cf/taste/example/netflix/TransposeToByUser.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/SplitBayesInput.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/bayes/WikipediaDatasetCreatorMapper.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/sequencelearning/hmm/PosTagger.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/sgd/LogisticModelParameters.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/classifier/sgd/SimpleCsvExamples.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/display/DisplayClustering.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/display/DisplayDirichlet.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/display/DisplayFuzzyKMeans.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/display/DisplayKMeans.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/minhash/LastfmClusterEvaluator.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/minhash/LastfmDataConverter.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/syntheticcontrol/meanshift/Job.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/fpm/pfpgrowth/dataset/KeyBasedStringTupleMapper.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDCrossover.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessEvaluator.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDMutation.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/DataLine.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/FileInfoParser.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluator.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosTool.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolMapper.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/BruteForceTravellingSalesman.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/EuropeanDistanceLookup.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/EvolutionaryTravellingSalesman.java
    mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/ItineraryPanel.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/classifier/bayes/SplitBayesInputTest.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/DescriptionUtilsTest.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/ToolReducerTest.java
    mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/utils/RandomRuleResults.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/benchmark/VectorBenchmarks.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/GenericJDBCDataModel.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/cf/taste/impl/model/mongodb/MongoDBDataModel.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/cdbw/CDbwEvaluator.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/InputMapper.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/conversion/meanshift/InputMapper.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/ClusterEvaluator.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsDriver.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/evaluation/RepresentativePointsMapper.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/clustering/lda/LDAPrintTopics.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/text/SequenceFilesFromDirectory.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/utils/clustering/ClusterDumper.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/ARFFIterator.java
    mahout/trunk/integration/src/main/java/org/apache/mahout/utils/vectors/arff/MapBackedARFFModel.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterDumper.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/TestClusterEvaluator.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/cdbw/TestCDbwEvaluator.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/clustering/dirichlet/TestL1ModelClustering.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/text/SequenceFilesFromMailArchivesTest.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/text/TestSequenceFilesFromDirectory.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluatorTest.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java
    mahout/trunk/integration/src/test/java/org/apache/mahout/utils/vectors/io/VectorWriterTest.java
    mahout/trunk/math/src/main/java/org/apache/mahout/math/AbstractMatrix.java
    mahout/trunk/math/src/main/java/org/apache/mahout/math/OrthonormalityVerifier.java
    mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/HebbianSolver.java
    mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/hebbian/TrainingState.java
    mahout/trunk/math/src/main/java/org/apache/mahout/math/decomposer/lanczos/LanczosState.java
    mahout/trunk/math/src/test/java/org/apache/mahout/math/MatrixTest.java
    mahout/trunk/math/src/test/java/org/apache/mahout/math/TestMatrixView.java
    mahout/trunk/math/src/test/java/org/apache/mahout/math/decomposer/SolverTest.java

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/FixedSizePriorityQueue.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/FixedSizePriorityQueue.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/FixedSizePriorityQueue.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/FixedSizePriorityQueue.java Fri Jun 10 21:58:14 2011
@@ -58,6 +58,10 @@ abstract class FixedSizePriorityQueue<T>
     return queue.isEmpty();
   }
 
+  public int size() {
+    return queue.size();
+  }
+
   public List<T> retrieve() {
     List<T> topItems = Lists.newArrayList(queue);
     Collections.sort(topItems, sortingComparator(comparator));

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommendedItemsWritable.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommendedItemsWritable.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommendedItemsWritable.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/RecommendedItemsWritable.java Fri Jun 10 21:58:14 2011
@@ -20,9 +20,9 @@ package org.apache.mahout.cf.taste.hadoo
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.io.Writable;
 import org.apache.mahout.cf.taste.impl.recommender.GenericRecommendedItem;
 import org.apache.mahout.cf.taste.recommender.RecommendedItem;
@@ -66,7 +66,7 @@ public final class RecommendedItemsWrita
   @Override
   public void readFields(DataInput in) throws IOException {
     int size = in.readInt();
-    recommended = new ArrayList<RecommendedItem>(size);
+    recommended = Lists.newArrayListWithCapacity(size);
     for (int i = 0; i < size; i++) {
       long itemID = Varint.readSignedVarLong(in);
       float value = in.readFloat();

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java Fri Jun 10 21:58:14 2011
@@ -18,6 +18,8 @@
 package org.apache.mahout.cf.taste.hadoop.als;
 
 import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.FloatWritable;
@@ -46,8 +48,6 @@ import org.apache.mahout.math.VectorWrit
 import org.apache.mahout.math.als.AlternateLeastSquaresSolver;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
@@ -210,7 +210,7 @@ public class ParallelALSFactorizationJob
     protected void reduce(VarIntWritable id, Iterable<FeatureVectorWithRatingWritable> values, Context ctx)
       throws IOException, InterruptedException {
       Vector featureVector = null;
-      Map<Integer,Float> ratings = new HashMap<Integer,Float>();
+      Map<Integer,Float> ratings = Maps.newHashMap();
       for (FeatureVectorWithRatingWritable value : values) {
         if (value.getFeatureVector() == null) {
           ratings.put(value.getIDIndex(), value.getRating());
@@ -249,7 +249,7 @@ public class ParallelALSFactorizationJob
     @Override
     protected void reduce(IndexedVarIntWritable key, Iterable<FeatureVectorWithRatingWritable> values, Context ctx)
       throws IOException, InterruptedException {
-      List<Vector> UorMColumns = new ArrayList<Vector>();
+      List<Vector> UorMColumns = Lists.newArrayList();
       Vector ratingVector = new RandomAccessSparseVector(Integer.MAX_VALUE);
       int n = 0;
       for (FeatureVectorWithRatingWritable value : values) {

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/DatasetSplitter.java (from r1134267, mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/DatasetSplitter.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/DatasetSplitter.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/DatasetSplitter.java&p1=mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/DatasetSplitter.java&r1=1134267&r2=1134456&rev=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/DatasetSplitter.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/DatasetSplitter.java Fri Jun 10 21:58:14 2011
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.utils.eval;
+package org.apache.mahout.cf.taste.hadoop.als.eval;
 
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.LongWritable;

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/InMemoryFactorizationEvaluator.java (from r1134267, mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/InMemoryFactorizationEvaluator.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/InMemoryFactorizationEvaluator.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/InMemoryFactorizationEvaluator.java&p1=mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/InMemoryFactorizationEvaluator.java&r1=1134267&r2=1134456&rev=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/InMemoryFactorizationEvaluator.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/InMemoryFactorizationEvaluator.java Fri Jun 10 21:58:14 2011
@@ -15,8 +15,9 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.utils.eval;
+package org.apache.mahout.cf.taste.hadoop.als.eval;
 
+import com.google.common.io.Closeables;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -109,7 +110,7 @@ public class InMemoryFactorizationEvalua
       double mae = maeAvg.getAverage();
       writer.write("RMSE: " + rmse + ", MAE: " + mae + "\n");
     } finally {
-      IOUtils.quietClose(writer);
+      Closeables.closeQuietly(writer);
     }
     return 0;
   }
@@ -135,7 +136,7 @@ public class InMemoryFactorizationEvalua
           }
         }
       } finally {
-        IOUtils.quietClose(reader);
+        Closeables.closeQuietly(reader);
       }
     }
     return matrix;
@@ -160,7 +161,7 @@ public class InMemoryFactorizationEvalua
           preferences.add(new GenericPreference(userID, itemID, value));
         }
       } finally {
-        IOUtils.quietClose(in);
+        Closeables.closeQuietly(in);
       }
     }
     return preferences;

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/ParallelFactorizationEvaluator.java (from r1134267, mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluator.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/ParallelFactorizationEvaluator.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/ParallelFactorizationEvaluator.java&p1=mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluator.java&r1=1134267&r2=1134456&rev=1134456&view=diff
==============================================================================
--- mahout/trunk/integration/src/main/java/org/apache/mahout/utils/eval/ParallelFactorizationEvaluator.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/als/eval/ParallelFactorizationEvaluator.java Fri Jun 10 21:58:14 2011
@@ -15,8 +15,9 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.utils.eval;
+package org.apache.mahout.cf.taste.hadoop.als.eval;
 
+import com.google.common.io.Closeables;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -99,7 +100,7 @@ public class ParallelFactorizationEvalua
       writer = new BufferedWriter(new OutputStreamWriter(outputStream));
       writer.write(String.valueOf(rmse));
     } finally {
-      IOUtils.quietClose(writer);
+      Closeables.closeQuietly(writer);
     }
 
     return 0;

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ItemFilterAsVectorAndPrefsReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ItemFilterAsVectorAndPrefsReducer.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ItemFilterAsVectorAndPrefsReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ItemFilterAsVectorAndPrefsReducer.java Fri Jun 10 21:58:14 2011
@@ -17,6 +17,7 @@
 
 package org.apache.mahout.cf.taste.hadoop.item;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.mapreduce.Reducer;
 import org.apache.mahout.cf.taste.hadoop.TasteHadoopUtils;
 import org.apache.mahout.math.RandomAccessSparseVector;
@@ -25,7 +26,6 @@ import org.apache.mahout.math.VarLongWri
 import org.apache.mahout.math.Vector;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -44,8 +44,8 @@ public class ItemFilterAsVectorAndPrefsR
     /* artificial NaN summand to exclude this item from the recommendations for all users specified in userIDs */
     vector.set(itemIDIndex, Double.NaN);
 
-    List<Long> userIDs = new ArrayList<Long>();
-    List<Float> prefValues = new ArrayList<Float>();
+    List<Long> userIDs = Lists.newArrayList();
+    List<Float> prefValues = Lists.newArrayList();
     for (VarLongWritable userID : values) {
       userIDs.add(userID.get());
       prefValues.add(1.0f);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ToVectorAndPrefReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ToVectorAndPrefReducer.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ToVectorAndPrefReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/ToVectorAndPrefReducer.java Fri Jun 10 21:58:14 2011
@@ -18,9 +18,9 @@
 package org.apache.mahout.cf.taste.hadoop.item;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.mapreduce.Reducer;
 import org.apache.mahout.math.VarIntWritable;
 import org.apache.mahout.math.Vector;
@@ -33,8 +33,8 @@ public final class ToVectorAndPrefReduce
                         Iterable<VectorOrPrefWritable> values,
                         Context context) throws IOException, InterruptedException {
 
-    List<Long> userIDs = new ArrayList<Long>();
-    List<Float> prefValues = new ArrayList<Float>();
+    List<Long> userIDs = Lists.newArrayList();
+    List<Float> prefValues = Lists.newArrayList();
     Vector similarityMatrixColumn = null;
     for (VectorOrPrefWritable value : values) {
       if (value.getVector() == null) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/item/VectorAndPrefsWritable.java Fri Jun 10 21:58:14 2011
@@ -20,9 +20,9 @@ package org.apache.mahout.cf.taste.hadoo
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.io.Writable;
 import org.apache.mahout.math.Varint;
 import org.apache.mahout.math.Vector;
@@ -73,8 +73,8 @@ public final class VectorAndPrefsWritabl
     writable.readFields(in);
     vector = writable.get();
     int size = Varint.readUnsignedVarInt(in);
-    userIDs = new ArrayList<Long>(size);
-    values = new ArrayList<Float>(size);
+    userIDs = Lists.newArrayListWithCapacity(size);
+    values = Lists.newArrayListWithCapacity(size);
     for (int i = 0; i < size; i++) {
       userIDs.add(Varint.readSignedVarLong(in));
       values.add(in.readFloat());

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/slopeone/SlopeOnePrefsToDiffsReducer.java Fri Jun 10 21:58:14 2011
@@ -18,10 +18,10 @@
 package org.apache.mahout.cf.taste.hadoop.slopeone;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import com.google.common.collect.Lists;
 import org.apache.hadoop.io.FloatWritable;
 import org.apache.hadoop.mapreduce.Reducer;
 import org.apache.mahout.cf.taste.hadoop.EntityEntityWritable;
@@ -35,7 +35,7 @@ public final class SlopeOnePrefsToDiffsR
   protected void reduce(VarLongWritable key,
                         Iterable<EntityPrefWritable> values,
                         Context context) throws IOException, InterruptedException {
-    List<EntityPrefWritable> prefs = new ArrayList<EntityPrefWritable>();
+    List<EntityPrefWritable> prefs = Lists.newArrayList();
     for (EntityPrefWritable writable : values) {
       prefs.add(new EntityPrefWritable(writable));
     }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RefreshHelper.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RefreshHelper.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RefreshHelper.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RefreshHelper.java Fri Jun 10 21:58:14 2011
@@ -17,13 +17,13 @@
 
 package org.apache.mahout.cf.taste.impl.common;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.locks.ReentrantLock;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -47,7 +47,7 @@ public final class RefreshHelper impleme
    *          encapsulates the containing object's own refresh logic
    */
   public RefreshHelper(Callable<?> refreshRunnable) {
-    this.dependencies = new ArrayList<Refreshable>(3);
+    this.dependencies = Lists.newArrayListWithCapacity(3);
     this.refreshLock = new ReentrantLock();
     this.refreshRunnable = refreshRunnable;
   }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java Fri Jun 10 21:58:14 2011
@@ -17,7 +17,6 @@
 
 package org.apache.mahout.cf.taste.impl.eval;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
@@ -29,6 +28,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.NoSuchItemException;
 import org.apache.mahout.cf.taste.common.NoSuchUserException;
 import org.apache.mahout.cf.taste.common.TasteException;
@@ -95,8 +95,8 @@ public abstract class AbstractDifference
                          DataModel dataModel,
                          double trainingPercentage,
                          double evaluationPercentage) throws TasteException {
-    Preconditions.checkArgument(recommenderBuilder != null, "recommenderBuilder is null");
-    Preconditions.checkArgument(dataModel != null, "dataModel is null");
+    Preconditions.checkNotNull(recommenderBuilder);
+    Preconditions.checkNotNull(dataModel);
     Preconditions.checkArgument(trainingPercentage >= 0.0 && trainingPercentage <= 1.0,
       "Invalid trainingPercentage: " + trainingPercentage);
     Preconditions.checkArgument(evaluationPercentage >= 0.0 && evaluationPercentage <= 1.0,
@@ -141,12 +141,12 @@ public abstract class AbstractDifference
       Preference newPref = new GenericPreference(userID, prefs.getItemID(i), prefs.getValue(i));
       if (random.nextDouble() < trainingPercentage) {
         if (trainingPrefs == null) {
-          trainingPrefs = new ArrayList<Preference>(3);
+          trainingPrefs = Lists.newArrayListWithCapacity(3);
         }
         trainingPrefs.add(newPref);
       } else {
         if (testPrefs == null) {
-          testPrefs = new ArrayList<Preference>(3);
+          testPrefs = Lists.newArrayListWithCapacity(3);
         }
         testPrefs.add(newPref);
       }
@@ -172,7 +172,7 @@ public abstract class AbstractDifference
   private double getEvaluation(FastByIDMap<PreferenceArray> testUserPrefs, Recommender recommender)
     throws TasteException {
     reset();
-    Collection<Callable<Void>> estimateCallables = new ArrayList<Callable<Void>>();
+    Collection<Callable<Void>> estimateCallables = Lists.newArrayList();
     AtomicInteger noEstimateCounter = new AtomicInteger();
     for (Map.Entry<Long,PreferenceArray> entry : testUserPrefs.entrySet()) {
       estimateCallables.add(
@@ -207,7 +207,7 @@ public abstract class AbstractDifference
   private static Collection<Callable<Void>> wrapWithStatsCallables(Collection<Callable<Void>> callables,
                                                                    AtomicInteger noEstimateCounter) {
     int size = callables.size();
-    Collection<Callable<Void>> wrapped = new ArrayList<Callable<Void>>(size);
+    Collection<Callable<Void>> wrapped = Lists.newArrayList();
     int count = 0;
     RunningAverageAndStdDev timing = new FullRunningAverageAndStdDev();
     for (Callable<Void> callable : callables) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java Fri Jun 10 21:58:14 2011
@@ -17,11 +17,11 @@
 
 package org.apache.mahout.cf.taste.impl.eval;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Random;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.NoSuchUserException;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.eval.DataModelBuilder;
@@ -213,7 +213,7 @@ public final class GenericRecommenderIRS
                                        DataModel dataModel) throws TasteException {
     PreferenceArray prefs2Array = dataModel.getPreferencesFromUser(userID2);
     if (id == userID2) {
-      List<Preference> prefs2 = new ArrayList<Preference>(prefs2Array.length());
+      List<Preference> prefs2 = Lists.newArrayListWithCapacity(prefs2Array.length());
       for (Preference pref : prefs2Array) {
         prefs2.add(pref);
       }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/LoadEvaluator.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/LoadEvaluator.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/LoadEvaluator.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/LoadEvaluator.java Fri Jun 10 21:58:14 2011
@@ -17,11 +17,11 @@
 
 package org.apache.mahout.cf.taste.impl.eval;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
 import org.apache.mahout.cf.taste.impl.common.SamplingLongPrimitiveIterator;
@@ -42,7 +42,7 @@ public final class LoadEvaluator {
     LongPrimitiveIterator userSampler = SamplingLongPrimitiveIterator.maybeWrapIterator(dataModel
         .getUserIDs(), sampleRate);
     recommender.recommend(userSampler.next(), 10); // Warm up
-    Collection<Callable<Void>> callables = new ArrayList<Callable<Void>>();
+    Collection<Callable<Void>> callables = Lists.newArrayList();
     while (userSampler.hasNext()) {
       callables.add(new LoadCallable(recommender, userSampler.next()));
     }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericDataModel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericDataModel.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericDataModel.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericDataModel.java Fri Jun 10 21:58:14 2011
@@ -17,12 +17,12 @@
 
 package org.apache.mahout.cf.taste.impl.model;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.NoSuchItemException;
 import org.apache.mahout.cf.taste.common.NoSuchUserException;
 import org.apache.mahout.cf.taste.common.Refreshable;
@@ -94,7 +94,7 @@ public final class GenericDataModel exte
         itemIDSet.add(itemID);
         Collection<Preference> prefsForItem = prefsForItems.get(itemID);
         if (prefsForItem == null) {
-          prefsForItem = new ArrayList<Preference>(2);
+          prefsForItem = Lists.newArrayListWithCapacity(2);
           prefsForItems.put(itemID, prefsForItem);
         }
         prefsForItem.add(preference);

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java Fri Jun 10 21:58:14 2011
@@ -20,7 +20,6 @@ package org.apache.mahout.cf.taste.impl.
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
@@ -28,6 +27,7 @@ import java.util.TreeMap;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.regex.Pattern;
 
+import com.google.common.collect.Lists;
 import com.google.common.io.Closeables;
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
@@ -494,7 +494,7 @@ public class FileDataModel extends Abstr
 
         if (!exists) {
           if (prefs == null) {
-            prefs = new ArrayList<Preference>(2);
+            prefs = Lists.newArrayListWithCapacity(2);
             ((FastByIDMap<Collection<Preference>>) data).put(userID, prefs);
           }
           prefs.add(new GenericPreference(userID, itemID, preferenceValue));

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/RandomRecommender.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/RandomRecommender.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/RandomRecommender.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/RandomRecommender.java Fri Jun 10 21:58:14 2011
@@ -17,11 +17,11 @@
 
 package org.apache.mahout.cf.taste.impl.recommender;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Random;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
@@ -67,7 +67,7 @@ public final class RandomRecommender ext
   public List<RecommendedItem> recommend(long userID, int howMany, IDRescorer rescorer) throws TasteException {
     DataModel dataModel = getDataModel();
     int numItems = dataModel.getNumItems();
-    List<RecommendedItem> result = new ArrayList<RecommendedItem>(howMany);
+    List<RecommendedItem> result = Lists.newArrayListWithCapacity(howMany);
     while (result.size() < howMany) {
       LongPrimitiveIterator it = dataModel.getItemIDs();
       it.skip(random.nextInt(numItems));

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TopItems.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TopItems.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TopItems.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TopItems.java Fri Jun 10 21:58:14 2011
@@ -17,13 +17,13 @@
 
 package org.apache.mahout.cf.taste.impl.recommender;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.PriorityQueue;
 import java.util.Queue;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.NoSuchItemException;
 import org.apache.mahout.cf.taste.common.NoSuchUserException;
 import org.apache.mahout.cf.taste.common.TasteException;
@@ -83,7 +83,7 @@ public final class TopItems {
     if (size == 0) {
       return Collections.emptyList();
     }
-    List<RecommendedItem> result = new ArrayList<RecommendedItem>(size);
+    List<RecommendedItem> result = Lists.newArrayListWithCapacity(size);
     result.addAll(topItems);
     Collections.sort(result, ByValueRecommendedItemComparator.getInstance());
     return result;
@@ -123,7 +123,7 @@ public final class TopItems {
     if (size == 0) {
       return NO_IDS;
     }
-    List<SimilarUser> sorted = new ArrayList<SimilarUser>(size);
+    List<SimilarUser> sorted = Lists.newArrayListWithCapacity(size);
     sorted.addAll(topUsers);
     Collections.sort(sorted);
     long[] result = new long[size];
@@ -168,8 +168,7 @@ public final class TopItems {
     if (size == 0) {
       return Collections.emptyList();
     }
-    List<GenericItemSimilarity.ItemItemSimilarity> result =
-        new ArrayList<GenericItemSimilarity.ItemItemSimilarity>(size);
+    List<GenericItemSimilarity.ItemItemSimilarity> result = Lists.newArrayListWithCapacity(size);
     result.addAll(topSimilarities);
     Collections.sort(result);
     return result;
@@ -200,8 +199,7 @@ public final class TopItems {
     if (size == 0) {
       return Collections.emptyList();
     }
-    List<GenericUserSimilarity.UserUserSimilarity> result =
-        new ArrayList<GenericUserSimilarity.UserUserSimilarity>(size);
+    List<GenericUserSimilarity.UserUserSimilarity> result = Lists.newArrayListWithCapacity(size);
     result.addAll(topSimilarities);
     Collections.sort(result);
     return result;

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java Fri Jun 10 21:58:14 2011
@@ -17,13 +17,13 @@
 
 package org.apache.mahout.cf.taste.impl.recommender;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Random;
 import java.util.concurrent.Callable;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastByIDMap;
@@ -202,7 +202,7 @@ public final class TreeClusteringRecomme
     }
 
     DataModel dataModel = getDataModel();
-    List<RecommendedItem> rescored = new ArrayList<RecommendedItem>(recommended.size());
+    List<RecommendedItem> rescored = Lists.newArrayListWithCapacity(recommended.size());
     // Only add items the user doesn't already have a preference for.
     // And that the rescorer doesn't "reject".
     for (RecommendedItem recommendedItem : recommended) {
@@ -257,7 +257,7 @@ public final class TreeClusteringRecomme
     DataModel model = getDataModel();
     int numUsers = model.getNumUsers();
     if (numUsers > 0) {
-      List<FastIDSet> newClusters = new ArrayList<FastIDSet>(numUsers);
+      List<FastIDSet> newClusters = Lists.newArrayListWithCapacity(numUsers);
       // Begin with a cluster for each user:
       LongPrimitiveIterator it = model.getUserIDs();
       while (it.hasNext()) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java Fri Jun 10 21:58:14 2011
@@ -17,7 +17,6 @@
 
 package org.apache.mahout.cf.taste.impl.recommender;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
@@ -27,6 +26,7 @@ import java.util.PriorityQueue;
 import java.util.Queue;
 import java.util.concurrent.Callable;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastByIDMap;
@@ -159,7 +159,7 @@ public final class TreeClusteringRecomme
     }
 
     DataModel dataModel = getDataModel();
-    List<RecommendedItem> rescored = new ArrayList<RecommendedItem>(recommended.size());
+    List<RecommendedItem> rescored = Lists.newArrayListWithCapacity(recommended.size());
     // Only add items the user doesn't already have a preference for.
     // And that the rescorer doesn't "reject".
     for (RecommendedItem recommendedItem : recommended) {
@@ -274,7 +274,7 @@ public final class TreeClusteringRecomme
 
     } else {
 
-      List<FastIDSet> clusters = new ArrayList<FastIDSet>();
+      List<FastIDSet> clusters = Lists.newArrayList();
       // Begin with a cluster for each user:
       LongPrimitiveIterator it = model.getUserIDs();
       while (it.hasNext()) {
@@ -397,7 +397,7 @@ public final class TreeClusteringRecomme
         }
       }
     }
-    List<ClusterClusterPair> result = new ArrayList<ClusterClusterPair>(queue);
+    List<ClusterClusterPair> result = Lists.newArrayList(queue);
     Collections.sort(result);
     return result;
   }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ALSWRFactorizer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ALSWRFactorizer.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ALSWRFactorizer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ALSWRFactorizer.java Fri Jun 10 21:58:14 2011
@@ -17,6 +17,7 @@
 
 package org.apache.mahout.cf.taste.impl.recommender.svd;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverage;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
@@ -31,7 +32,6 @@ import org.apache.mahout.math.als.Altern
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
 import java.util.concurrent.ExecutorService;
@@ -150,7 +150,7 @@ public class ALSWRFactorizer extends Abs
           queue.execute(new Runnable() {
             @Override
             public void run() {
-              List<Vector> featureVectors = new ArrayList<Vector>();
+              List<Vector> featureVectors = Lists.newArrayList();
               while (itemIDsFromUser.hasNext()) {
                 long itemID = itemIDsFromUser.nextLong();
                 featureVectors.add(features.getItemFeatureColumn(itemIndex(itemID)));
@@ -165,7 +165,7 @@ public class ALSWRFactorizer extends Abs
         try {
           queue.awaitTermination(dataModel.getNumUsers(), TimeUnit.SECONDS);
         } catch (InterruptedException e) {
-          throw new IllegalStateException("Error when computing user features", e);
+          log.warn("Error when computing user features", e);
         }
       }
 
@@ -179,7 +179,7 @@ public class ALSWRFactorizer extends Abs
           queue.execute(new Runnable() {
             @Override
             public void run() {
-              List<Vector> featureVectors = new ArrayList<Vector>();
+              List<Vector> featureVectors = Lists.newArrayList();
               for (Preference pref : itemPrefs) {
                 long userID = pref.getUserID();
                 featureVectors.add(features.getUserFeatureColumn(userIndex(userID)));
@@ -194,7 +194,7 @@ public class ALSWRFactorizer extends Abs
         try {
           queue.awaitTermination(dataModel.getNumItems(), TimeUnit.SECONDS);
         } catch (InterruptedException e) {
-          throw new IllegalStateException("Error when computing item features", e);
+          log.warn("Error when computing item features", e);
         }
       }
     }

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVDFactorizer.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVDFactorizer.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVDFactorizer.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVDFactorizer.java Fri Jun 10 21:58:14 2011
@@ -17,11 +17,11 @@
 
 package org.apache.mahout.cf.taste.impl.recommender.svd;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Random;
 
+import com.google.common.collect.Lists;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverage;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
@@ -98,7 +98,7 @@ public final class ExpectationMaximizati
         rightVectors[itemIndex][feature] = defaultValue + (random.nextDouble() - 0.5) * interval * randomNoise;
       }
     }
-    cachedPreferences = new ArrayList<SVDPreference>(dataModel.getNumUsers());
+    cachedPreferences = Lists.newArrayListWithCapacity(dataModel.getNumUsers());
     cachePreferences();
     double rmse = dataModel.getMaxPreference() - dataModel.getMinPreference();
     for (int ii = 0; ii < numFeatures; ii++) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/AbstractSimilarity.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/AbstractSimilarity.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/AbstractSimilarity.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/AbstractSimilarity.java Fri Jun 10 21:58:14 2011
@@ -236,9 +236,8 @@ abstract class AbstractSimilarity extend
     // "Center" the data. If my math is correct, this'll do it.
     double result;
     if (centerData) {
-      double n = count;
-      double meanX = sumX / n;
-      double meanY = sumY / n;
+      double meanX = sumX / count;
+      double meanY = sumY / count;
       // double centeredSumXY = sumXY - meanY * sumX - meanX * sumY + n * meanX * meanY;
       double centeredSumXY = sumXY - meanY * sumX;
       // double centeredSumX2 = sumX2 - 2.0 * meanX * sumX + n * meanX * meanX;

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=1134456&r1=1134455&r2=1134456&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 Fri Jun 10 21:58:14 2011
@@ -23,10 +23,10 @@ import java.io.IOException;
 import java.io.Reader;
 import java.io.Writer;
 import java.nio.charset.Charset;
-import java.util.ArrayList;
 import java.util.List;
 
 import com.google.common.base.Charsets;
+import com.google.common.collect.Lists;
 import com.google.common.io.Closeables;
 import com.google.common.io.Files;
 import org.apache.commons.cli2.CommandLine;
@@ -232,7 +232,7 @@ public final class BayesFileFormatter {
   public static String[] readerToDocument(Analyzer analyzer, Reader reader) throws IOException {
     TokenStream ts = analyzer.reusableTokenStream("", reader);
     
-    List<String> coll = new ArrayList<String>();
+    List<String> coll = Lists.newArrayList();
     TermAttribute termAtt = ts.addAttribute(TermAttribute.class);
     ts.reset();
     while (ts.incrementToken()) {

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ClassifierResult.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ClassifierResult.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ClassifierResult.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/ClassifierResult.java Fri Jun 10 21:58:14 2011
@@ -17,10 +17,21 @@
 
 package org.apache.mahout.classifier;
 
+import java.util.Comparator;
+
 /**
- * Result of a Document Classification. The label and the associated score(Usually probabilty)
+ * Result of a document classification. The label and the associated score (usually probabilty)
  */
 public class ClassifierResult {
+
+  public static final Comparator<ClassifierResult> COMPARE_BY_SCORE_AND_LABEL =
+      new Comparator<ClassifierResult>() {
+        @Override
+        public int compare(ClassifierResult cr1, ClassifierResult cr2) {
+          return cr1.score < cr2.score ? 1 : cr1.score > cr2.score ? -1 : cr1.label.compareTo(cr2.label);
+        }
+      };
+
   private String label;
   private double score;
   

Modified: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/Classify.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/Classify.java?rev=1134456&r1=1134455&r2=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/Classify.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/Classify.java Fri Jun 10 21:58:14 2011
@@ -32,13 +32,9 @@ import org.apache.commons.cli2.commandli
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
 import org.apache.lucene.util.Version;
-import org.apache.mahout.classifier.bayes.algorithm.BayesAlgorithm;
-import org.apache.mahout.classifier.bayes.algorithm.CBayesAlgorithm;
-import org.apache.mahout.classifier.bayes.common.BayesParameters;
-import org.apache.mahout.classifier.bayes.datastore.InMemoryBayesDatastore;
-import org.apache.mahout.classifier.bayes.interfaces.Algorithm;
-import org.apache.mahout.classifier.bayes.interfaces.Datastore;
-import org.apache.mahout.classifier.bayes.model.ClassifierContext;
+import org.apache.mahout.classifier.bayes.*;
+import org.apache.mahout.classifier.bayes.Datastore;
+import org.apache.mahout.classifier.bayes.ClassifierContext;
 import org.apache.mahout.common.nlp.NGrams;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Added: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/AbstractBayesAlgorithm.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/AbstractBayesAlgorithm.java?rev=1134456&view=auto
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/AbstractBayesAlgorithm.java (added)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/AbstractBayesAlgorithm.java Fri Jun 10 21:58:14 2011
@@ -0,0 +1,55 @@
+/**
+ * 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.
+ */
+
+package org.apache.mahout.classifier.bayes;
+
+import org.apache.mahout.cf.taste.common.TopK;
+import org.apache.mahout.classifier.ClassifierResult;
+
+import java.util.Collection;
+
+abstract class AbstractBayesAlgorithm implements Algorithm {
+
+  @Override
+  public ClassifierResult[] classifyDocument(String[] document, Datastore datastore, String defaultCategory,
+      int numResults) throws InvalidDatastoreException {
+    Collection<String> categories = datastore.getKeys("labelWeight");
+    TopK<ClassifierResult> topResults =
+        new TopK<ClassifierResult>(numResults, ClassifierResult.COMPARE_BY_SCORE_AND_LABEL);
+    for (String category : categories) {
+      double prob = documentWeight(datastore, category, document);
+      if (prob > 0.0) {
+        topResults.offer(new ClassifierResult(category, prob));
+      }
+    }
+    if (topResults.isEmpty()) {
+      return new ClassifierResult[] { new ClassifierResult(defaultCategory, 0.0) };
+    } else {
+      return topResults.retrieve().toArray(new ClassifierResult[topResults.size()]);
+    }
+  }
+
+  @Override
+  public void initialize(Datastore datastore) throws InvalidDatastoreException {
+    datastore.getKeys("labelWeight");
+  }
+
+  @Override
+  public Collection<String> getLabels(Datastore datastore) throws InvalidDatastoreException {
+    return datastore.getKeys("labelWeight");
+  }
+}

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/Algorithm.java (from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/interfaces/Algorithm.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/Algorithm.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/Algorithm.java&p1=mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/interfaces/Algorithm.java&r1=1134267&r2=1134456&rev=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/interfaces/Algorithm.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/Algorithm.java Fri Jun 10 21:58:14 2011
@@ -15,12 +15,11 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.classifier.bayes.interfaces;
+package org.apache.mahout.classifier.bayes;
 
 import java.util.Collection;
 
 import org.apache.mahout.classifier.ClassifierResult;
-import org.apache.mahout.classifier.bayes.exceptions.InvalidDatastoreException;
 
 /**
  * The algorithm interface for implementing variations of bayes Algorithm
@@ -75,7 +74,7 @@ public interface Algorithm {
    * Get the weighted probability of the feature.
    * 
    * @param datastore
-   *          The {@link org.apache.mahout.classifier.bayes.interfaces.Datastore} (InMemory)
+   *          The {@link Datastore} (InMemory)
    * @param label
    *          The label of the feature
    * @param feature
@@ -90,7 +89,7 @@ public interface Algorithm {
    * of a particular class
    * 
    * @param datastore
-   *          The {@link org.apache.mahout.classifier.bayes.interfaces.Datastore} (InMemory)
+   *          The {@link Datastore} (InMemory)
    * @param label
    *          The label to calculate the probability of
    * @param document
@@ -104,7 +103,7 @@ public interface Algorithm {
    * Returns the labels in the given Model
    * 
    * @param datastore
-   *          The {@link org.apache.mahout.classifier.bayes.interfaces.Datastore} (InMemory)
+   *          The {@link Datastore} (InMemory)
    * @throws InvalidDatastoreException
    * @return {@link Collection} of labels
    */

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/BayesAlgorithm.java (from r1134267, 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/BayesAlgorithm.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/BayesAlgorithm.java&p1=mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/algorithm/BayesAlgorithm.java&r1=1134267&r2=1134456&rev=1134456&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/BayesAlgorithm.java Fri Jun 10 21:58:14 2011
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.classifier.bayes.algorithm;
+package org.apache.mahout.classifier.bayes;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -25,10 +25,6 @@ import java.util.PriorityQueue;
 
 import org.apache.commons.lang.mutable.MutableDouble;
 import org.apache.mahout.classifier.ClassifierResult;
-import org.apache.mahout.classifier.bayes.common.ByScoreLabelResultComparator;
-import org.apache.mahout.classifier.bayes.exceptions.InvalidDatastoreException;
-import org.apache.mahout.classifier.bayes.interfaces.Algorithm;
-import org.apache.mahout.classifier.bayes.interfaces.Datastore;
 import org.apache.mahout.math.function.ObjectIntProcedure;
 import org.apache.mahout.math.map.OpenObjectIntHashMap;
 
@@ -36,7 +32,7 @@ import org.apache.mahout.math.map.OpenOb
  * Class implementing the Naive Bayes Classifier Algorithm
  * 
  */
-public class BayesAlgorithm implements Algorithm {
+public class BayesAlgorithm extends AbstractBayesAlgorithm {
   
   @Override
   public ClassifierResult classifyDocument(String[] document,
@@ -58,36 +54,6 @@ public class BayesAlgorithm implements A
   }
   
   @Override
-  public ClassifierResult[] classifyDocument(String[] document,
-                                             Datastore datastore,
-                                             String defaultCategory,
-                                             int numResults) throws InvalidDatastoreException {
-    Collection<String> categories = datastore.getKeys("labelWeight");
-    PriorityQueue<ClassifierResult> pq = new PriorityQueue<ClassifierResult>(numResults,
-        new ByScoreLabelResultComparator());
-    for (String category : categories) {
-      double prob = documentWeight(datastore, category, document);
-      if (prob > 0.0) {
-        pq.add(new ClassifierResult(category, prob));
-        if (pq.size() > numResults) {
-          pq.remove();
-        }
-      }
-    }
-    
-    if (pq.isEmpty()) {
-      return new ClassifierResult[] {new ClassifierResult(defaultCategory, 0.0)};
-    } else {
-      List<ClassifierResult> result = new ArrayList<ClassifierResult>(pq.size());
-      while (!pq.isEmpty()) {
-        result.add(pq.remove());
-      }
-      Collections.reverse(result);
-      return result.toArray(new ClassifierResult[pq.size()]);
-    }
-  }
-  
-  @Override
   public double featureWeight(Datastore datastore, String label, String feature) throws InvalidDatastoreException {
     double result = datastore.getWeight("weight", feature, label);
     double vocabCount = datastore.getWeight("sumWeight", "vocabCount");
@@ -97,28 +63,18 @@ public class BayesAlgorithm implements A
     double weight = Math.log(numerator / denominator);
     return -weight;
   }
-  
-  @Override
-  public void initialize(Datastore datastore) throws InvalidDatastoreException {
-    datastore.getKeys("labelWeight");
-  }
-  
+
   @Override
   public double documentWeight(final Datastore datastore,
                                final String label,
                                String[] document) {
     OpenObjectIntHashMap<String> wordList = new OpenObjectIntHashMap<String>(document.length / 2);
     for (String word : document) {
-      if (wordList.containsKey(word)) {
-        wordList.put(word, wordList.get(word) + 1);
-      } else {
-        wordList.put(word, 1);
-      }
+      wordList.adjustOrPutValue(word, 1, 1);
     }
     final MutableDouble result = new MutableDouble(0.0);
     
     wordList.forEachPair(new ObjectIntProcedure<String>() {
-      
       @Override
       public boolean apply(String word, int frequency) {
         try {
@@ -131,10 +87,4 @@ public class BayesAlgorithm implements A
     });
     return result.doubleValue();
   }
-  
-  @Override
-  public Collection<String> getLabels(Datastore datastore) throws InvalidDatastoreException {
-    return datastore.getKeys("labelWeight");
-  }
-  
 }

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/BayesParameters.java (from r1134267, 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/BayesParameters.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/BayesParameters.java&p1=mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/BayesParameters.java&r1=1134267&r2=1134456&rev=1134456&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/BayesParameters.java Fri Jun 10 21:58:14 2011
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.classifier.bayes.common;
+package org.apache.mahout.classifier.bayes;
 
 import java.io.IOException;
 

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/ByScoreLabelResultComparator.java (from r1134267, mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/ByScoreLabelResultComparator.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/ByScoreLabelResultComparator.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/ByScoreLabelResultComparator.java&p1=mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/ByScoreLabelResultComparator.java&r1=1134267&r2=1134456&rev=1134456&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/common/ByScoreLabelResultComparator.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/classifier/bayes/ByScoreLabelResultComparator.java Fri Jun 10 21:58:14 2011
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.classifier.bayes.common;
+package org.apache.mahout.classifier.bayes;
 
 import java.io.Serializable;
 import java.util.Comparator;



Mime
View raw message