You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by sr...@apache.org on 2008/05/09 23:35:17 UTC
svn commit: r654943 [1/9] - in /lucene/mahout/trunk/core: ./ lib/
src/main/examples/org/ src/main/examples/org/apache/
src/main/examples/org/apache/mahout/ src/main/examples/org/apache/mahout/cf/
src/main/examples/org/apache/mahout/cf/taste/ src/main/e...
Author: srowen
Date: Fri May 9 14:35:12 2008
New Revision: 654943
URL: http://svn.apache.org/viewvc?rev=654943&view=rev
Log:
MAHOUT-37: initial commit of contributed Taste code
Added:
lucene/mahout/trunk/core/build.properties
lucene/mahout/trunk/core/lib/commons-dbcp-1.2.2.jar (with props)
lucene/mahout/trunk/core/lib/commons-dbcp-LICENSE.txt
lucene/mahout/trunk/core/lib/commons-pool-1.4.jar (with props)
lucene/mahout/trunk/core/lib/commons-pool-LICENSE.txt
lucene/mahout/trunk/core/lib/ejb-2_1-api.jar (with props)
lucene/mahout/trunk/core/lib/servlet-api.jar (with props)
lucene/mahout/trunk/core/src/main/examples/org/
lucene/mahout/trunk/core/src/main/examples/org/apache/
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensDataModel.java
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommender.java
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderBuilder.java
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderEvaluatorRunner.java
lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/Movie.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/Refreshable.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/TasteException.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/ItemCorrelation.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/PreferenceInferrer.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/UserCorrelation.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJB.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBBean.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBHome.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocal.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocalHome.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/ejb-jar.xml
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/mapping.xml
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/webservices.xml
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/eval/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/eval/IRStatistics.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/eval/RecommenderBuilder.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/eval/RecommenderEvaluator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/eval/RecommenderIRStatsEvaluator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/ArrayIterator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/CompactRunningAverage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/CompactRunningAverageAndStdDev.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/EmptyIterable.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/EmptyIterator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastMap.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FullRunningAverage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FullRunningAverageAndStdDev.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/IOUtils.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/IteratorIterable.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/IteratorUtils.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/Pair.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RandomUtils.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RunningAverage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RunningAverageAndStdDev.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SoftCache.java (with props)
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/WeightedRunningAverage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/correlation/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/correlation/AveragingPreferenceInferrer.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/correlation/GenericItemCorrelation.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/correlation/PearsonCorrelation.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/correlation/SpearmanCorrelation.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AverageAbsoluteDifferenceRecommenderEvaluator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/IRStatisticsImpl.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/RMSRecommenderEvaluator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/ByItemPreferenceComparator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/ByUserPreferenceComparator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/ByValuePreferenceComparator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/DetailedPreference.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericDataModel.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericItem.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericPreference.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/GenericUser.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/AbstractJDBCDataModel.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/ConnectionPoolDataSource.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/GenericJDBCDataModel.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/jdbc/MySQLJDBCDataModel.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/neighborhood/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/neighborhood/AbstractUserNeighborhood.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/neighborhood/NearestNUserNeighborhood.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/neighborhood/ThresholdUserNeighborhood.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/AbstractRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/ByRescoreComparator.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/CachingRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/ClusterSimilarity.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/FarthestNeighborClusterSimilarity.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericRecommendedItem.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericUserBasedRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/ItemAverageRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/ItemUserAverageRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/NearestNeighborClusterSimilarity.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/NullRescorer.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TopItems.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/InvertedRunningAverage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/InvertedRunningAverageAndStdDev.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/MemoryDiffStorage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/SlopeOneRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/jdbc/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/jdbc/AbstractJDBCDiffStorage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/jdbc/MySQLJDBCDiffStorage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/transforms/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/transforms/CaseAmplification.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/transforms/Counters.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/transforms/InverseUserFrequency.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/transforms/ZScore.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/model/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/model/DataModel.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/model/Item.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/model/JDBCDataModel.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/model/Preference.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/model/User.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/neighborhood/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/neighborhood/UserNeighborhood.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/ClusteringRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/ItemBasedRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/RecommendedItem.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/Recommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/Rescorer.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/UserBasedRecommender.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/slopeone/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/slopeone/DiffStorage.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/transforms/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/transforms/CorrelationTransform.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/transforms/PreferenceTransform2.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/web/
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/web/RecommenderService.jws
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/web/RecommenderServlet.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/web/RecommenderSingleton.java
lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/web/web.xml
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/common/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/common/CommonTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/LoadTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/TasteTestCase.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/EmptyIteratorTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastMapTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/IteratorUtilsTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/RunningAverageAndStdDevTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/RunningAverageTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/correlation/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/correlation/AveragingPreferenceInferrerTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/correlation/CorrelationTestCase.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/correlation/GenericItemCorrelationTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/correlation/PearsonCorrelationTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/correlation/SpearmanCorrelationTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/eval/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/eval/AverageAbsoluteDifferenceRecommenderEvaluatorTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluatorImplTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/eval/RMSRecommenderEvaluatorTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/model/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/model/file/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModelTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/model/file/test1.txt
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/model/jdbc/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/model/jdbc/MySQLJDBCDataModelTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/neighborhood/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/neighborhood/DummyCorrelation.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/neighborhood/NearestNNeighborhoodTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/neighborhood/ThresholdNeighborhoodTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/CachingRecommenderTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommenderTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/GenericUserBasedRecommenderTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/MockRecommender.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/NullRescorerTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/ReversingRescorer.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommenderTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/recommender/slopeone/SlopeOneRecommenderTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/transforms/
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/transforms/CaseAmplificationTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/transforms/InverseUserFrequencyTest.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/transforms/TransformTestCase.java
lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/transforms/ZScoreTest.java
lucene/mahout/trunk/core/taste-build.properties
lucene/mahout/trunk/core/taste-build.xml
Modified:
lucene/mahout/trunk/core/pom.xml
Added: lucene/mahout/trunk/core/build.properties
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/build.properties?rev=654943&view=auto
==============================================================================
(empty)
Added: lucene/mahout/trunk/core/lib/commons-dbcp-1.2.2.jar
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/lib/commons-dbcp-1.2.2.jar?rev=654943&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lucene/mahout/trunk/core/lib/commons-dbcp-1.2.2.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lucene/mahout/trunk/core/lib/commons-dbcp-LICENSE.txt
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/lib/commons-dbcp-LICENSE.txt?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/lib/commons-dbcp-LICENSE.txt (added)
+++ lucene/mahout/trunk/core/lib/commons-dbcp-LICENSE.txt Fri May 9 14:35:12 2008
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
Added: lucene/mahout/trunk/core/lib/commons-pool-1.4.jar
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/lib/commons-pool-1.4.jar?rev=654943&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lucene/mahout/trunk/core/lib/commons-pool-1.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lucene/mahout/trunk/core/lib/commons-pool-LICENSE.txt
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/lib/commons-pool-LICENSE.txt?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/lib/commons-pool-LICENSE.txt (added)
+++ lucene/mahout/trunk/core/lib/commons-pool-LICENSE.txt Fri May 9 14:35:12 2008
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
Added: lucene/mahout/trunk/core/lib/ejb-2_1-api.jar
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/lib/ejb-2_1-api.jar?rev=654943&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lucene/mahout/trunk/core/lib/ejb-2_1-api.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: lucene/mahout/trunk/core/lib/servlet-api.jar
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/lib/servlet-api.jar?rev=654943&view=auto
==============================================================================
Binary file - no diff available.
Propchange: lucene/mahout/trunk/core/lib/servlet-api.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: lucene/mahout/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/pom.xml?rev=654943&r1=654942&r2=654943&view=diff
==============================================================================
--- lucene/mahout/trunk/core/pom.xml (original)
+++ lucene/mahout/trunk/core/pom.xml Fri May 9 14:35:12 2008
@@ -159,6 +159,30 @@
</dependency>
<dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.2.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb</artifactId>
+ <version>2.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ <version>1.4</version>
+ </dependency>
+
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
Added: lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensDataModel.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensDataModel.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensDataModel.java (added)
+++ lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensDataModel.java Fri May 9 14:35:12 2008
@@ -0,0 +1,143 @@
+/**
+ * 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.cf.taste.example.grouplens;
+
+import org.apache.mahout.cf.taste.impl.common.IOUtils;
+import org.apache.mahout.cf.taste.impl.model.file.FileDataModel;
+import org.apache.mahout.cf.taste.model.Item;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
+public final class GroupLensDataModel extends FileDataModel {
+
+ private final Map<String, Movie> movieMap;
+
+ GroupLensDataModel() throws IOException {
+ this(readResourceToTempFile("/org/apache/mahout/cf//taste/example/grouplens/ratings.dat"),
+ readResourceToTempFile("/org/apache/mahout/cf//taste/example/grouplens/movies.dat"));
+ }
+
+ /**
+ * @param ratingsFile GroupLens ratings.dat file in its native format
+ * @param moviesFile GroupLens movies.dat file in its native format
+ * @throws IOException if an error occurs while reading or writing files
+ */
+ public GroupLensDataModel(File ratingsFile, File moviesFile) throws IOException {
+ super(convertGLFile(ratingsFile, true));
+ File convertedMoviesFile = convertGLFile(moviesFile, false);
+ BufferedReader reader = new BufferedReader(new FileReader(convertedMoviesFile));
+ movieMap = new HashMap<String, Movie>(5001);
+ try {
+ for (String line; (line = reader.readLine()) != null;) {
+ String[] tokens = line.split(",");
+ String id = tokens[0];
+ movieMap.put(id, new Movie(id, tokens[1], tokens[2]));
+ }
+ } finally {
+ IOUtils.quietClose(reader);
+ }
+ }
+
+ @Override
+ protected Item buildItem(String id) {
+ Item item = movieMap.get(id);
+ if (item == null) {
+ throw new NoSuchElementException();
+ }
+ return item;
+ }
+
+ private static File convertGLFile(File originalFile, boolean ratings) throws IOException {
+ // Now translate the file; remove commas, then convert "::" delimiter to comma
+ File resultFile = new File(new File(System.getProperty("java.io.tmpdir")),
+ "taste." + (ratings ? "ratings" : "movies") + ".txt");
+ if (!resultFile.exists()) {
+ BufferedReader reader = null;
+ PrintWriter writer = null;
+ try {
+ reader = new BufferedReader(new FileReader(originalFile), 32768);
+ writer = new PrintWriter(new FileWriter(resultFile));
+ for (String line; (line = reader.readLine()) != null;) {
+ String convertedLine;
+ if (ratings) {
+ // toss the last column of data, which is a timestamp we don't want
+ convertedLine = line.substring(0, line.lastIndexOf("::")).replace("::", ",");
+ } else {
+ convertedLine = line.replace(",", "").replace("::", ",");
+ }
+ writer.println(convertedLine);
+ }
+ writer.flush();
+ } catch (FileNotFoundException fnfe) {
+ resultFile.delete();
+ throw fnfe;
+ } catch (IOException ioe) {
+ resultFile.delete();
+ throw ioe;
+ } finally {
+ IOUtils.quietClose(writer);
+ IOUtils.quietClose(reader);
+ }
+ }
+ return resultFile;
+ }
+
+ private static File readResourceToTempFile(String resourceName) throws IOException {
+ InputStream is = GroupLensRecommender.class.getResourceAsStream(resourceName);
+ if (is == null) {
+ is = new FileInputStream("src/example" + resourceName);
+ }
+ try {
+ File tempFile = File.createTempFile("taste", null);
+ tempFile.deleteOnExit();
+ OutputStream os = new FileOutputStream(tempFile);
+ try {
+ int bytesRead;
+ for (byte[] buffer = new byte[32768]; (bytesRead = is.read(buffer)) > 0;) {
+ os.write(buffer, 0, bytesRead);
+ }
+ os.flush();
+ return tempFile;
+ } finally {
+ IOUtils.quietClose(os);
+ }
+ } finally {
+ IOUtils.quietClose(is);
+ }
+ }
+
+
+ @Override
+ public String toString() {
+ return "GroupLensDataModel";
+ }
+
+}
Added: lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommender.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommender.java (added)
+++ lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommender.java Fri May 9 14:35:12 2008
@@ -0,0 +1,92 @@
+/**
+ * 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.cf.taste.example.grouplens;
+
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.impl.recommender.CachingRecommender;
+import org.apache.mahout.cf.taste.impl.recommender.slopeone.SlopeOneRecommender;
+import org.apache.mahout.cf.taste.model.DataModel;
+import org.apache.mahout.cf.taste.model.Item;
+import org.apache.mahout.cf.taste.recommender.RecommendedItem;
+import org.apache.mahout.cf.taste.recommender.Recommender;
+import org.apache.mahout.cf.taste.recommender.Rescorer;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * A simple {@link Recommender} implemented for the GroupLens demo.
+ */
+public final class GroupLensRecommender implements Recommender {
+
+ private final Recommender recommender;
+
+ /**
+ * @throws IOException if an error occurs while creating the {@link GroupLensDataModel}
+ * @throws TasteException if an error occurs while initializing this {@link GroupLensRecommender}
+ */
+ public GroupLensRecommender() throws IOException, TasteException {
+ this(new GroupLensDataModel());
+ }
+
+ /**
+ * <p>Alternate constructor that takes a {@link DataModel} argument, which allows this {@link Recommender}
+ * to be used with the {@link org.apache.mahout.cf.taste.eval.RecommenderEvaluator} framework.</p>
+ *
+ * @param dataModel data model
+ * @throws TasteException if an error occurs while initializing this {@link GroupLensRecommender}
+ */
+ public GroupLensRecommender(DataModel dataModel) throws TasteException {
+ recommender = new CachingRecommender(new SlopeOneRecommender(dataModel));
+ }
+
+ public List<RecommendedItem> recommend(Object userID, int howMany) throws TasteException {
+ return recommender.recommend(userID, howMany);
+ }
+
+ public List<RecommendedItem> recommend(Object userID, int howMany, Rescorer<Item> rescorer)
+ throws TasteException {
+ return recommender.recommend(userID, howMany, rescorer);
+ }
+
+ public double estimatePreference(Object userID, Object itemID) throws TasteException {
+ return recommender.estimatePreference(userID, itemID);
+ }
+
+ public void setPreference(Object userID, Object itemID, double value) throws TasteException {
+ recommender.setPreference(userID, itemID, value);
+ }
+
+ public void removePreference(Object userID, Object itemID) throws TasteException {
+ recommender.removePreference(userID, itemID);
+ }
+
+ public DataModel getDataModel() {
+ return recommender.getDataModel();
+ }
+
+ public void refresh() {
+ recommender.refresh();
+ }
+
+ @Override
+ public String toString() {
+ return "GroupLensRecommender[recommender:" + recommender + ']';
+ }
+
+}
Added: lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderBuilder.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderBuilder.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderBuilder.java (added)
+++ lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderBuilder.java Fri May 9 14:35:12 2008
@@ -0,0 +1,31 @@
+/**
+ * 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.cf.taste.example.grouplens;
+
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.eval.RecommenderBuilder;
+import org.apache.mahout.cf.taste.model.DataModel;
+import org.apache.mahout.cf.taste.recommender.Recommender;
+
+final class GroupLensRecommenderBuilder implements RecommenderBuilder {
+
+ public Recommender buildRecommender(DataModel dataModel) throws TasteException {
+ return new GroupLensRecommender(dataModel);
+ }
+
+}
Added: lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderEvaluatorRunner.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderEvaluatorRunner.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderEvaluatorRunner.java (added)
+++ lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/GroupLensRecommenderEvaluatorRunner.java Fri May 9 14:35:12 2008
@@ -0,0 +1,45 @@
+/**
+ * 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.cf.taste.example.grouplens;
+
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.eval.RecommenderEvaluator;
+import org.apache.mahout.cf.taste.impl.eval.AverageAbsoluteDifferenceRecommenderEvaluator;
+
+import java.io.IOException;
+
+/**
+ * <p>A simple example "runner" class which will evaluate the performance of the current
+ * implementation of {@link GroupLensRecommender}.</p>
+ */
+public final class GroupLensRecommenderEvaluatorRunner {
+
+ private GroupLensRecommenderEvaluatorRunner() {
+ // do nothing
+ }
+
+ public static void main(String... args) throws IOException, TasteException {
+ RecommenderEvaluator evaluator = new AverageAbsoluteDifferenceRecommenderEvaluator();
+ double evaluation = evaluator.evaluate(new GroupLensRecommenderBuilder(),
+ new GroupLensDataModel(),
+ 0.9,
+ 0.1);
+ System.out.println(evaluation);
+ }
+
+}
Added: lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/Movie.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/Movie.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/Movie.java (added)
+++ lucene/mahout/trunk/core/src/main/examples/org/apache/mahout/cf/taste/example/grouplens/Movie.java Fri May 9 14:35:12 2008
@@ -0,0 +1,38 @@
+/**
+ * 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.cf.taste.example.grouplens;
+
+import org.apache.mahout.cf.taste.impl.model.GenericItem;
+
+final class Movie extends GenericItem<String> {
+
+ private final String movieTitle;
+ private final String genres;
+
+ Movie(String id, String movieTitle, String genres) {
+ super(id);
+ this.movieTitle = movieTitle;
+ this.genres = genres;
+ }
+
+ @Override
+ public String toString() {
+ return getID().toString() + '\t' + movieTitle + '\t' + genres;
+ }
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/Refreshable.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/Refreshable.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/Refreshable.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/Refreshable.java Fri May 9 14:35:12 2008
@@ -0,0 +1,38 @@
+/**
+ * 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.cf.taste.common;
+
+/**
+ * <p>Implementations of this interface have state that can be periodically refreshed. For example, an
+ * implementation instance might contain some pre-computed information that should be periodically
+ * refreshed. The {@link #refresh()} method triggers such a refresh.</p>
+ *
+ * <p>All Taste components implement this. In particular, {@link org.apache.mahout.cf.taste.recommender.Recommender}s do.
+ * Callers may want to call {@link #refresh()} periodically to re-compute information throughout the system
+ * and bring it up to date, though this operation may be expensive.</p>
+ */
+public interface Refreshable {
+
+ /**
+ * <p>Triggers "refresh" -- whatever that means -- of the implementation. The general contract is that
+ * any {@link Refreshable} should always leave itself in a consistent, operational state, and that
+ * the refresh atomically updates internal state from old to new.</p>
+ */
+ void refresh();
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/TasteException.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/TasteException.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/TasteException.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/common/TasteException.java Fri May 9 14:35:12 2008
@@ -0,0 +1,41 @@
+/**
+ * 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.cf.taste.common;
+
+/**
+ * <p>An exception thrown when an error occurs inside the Taste engine.</p>
+ */
+public final class TasteException extends Exception {
+
+ public TasteException() {
+ super();
+ }
+
+ public TasteException(String message) {
+ super(message);
+ }
+
+ public TasteException(Throwable cause) {
+ super(cause);
+ }
+
+ public TasteException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/ItemCorrelation.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/ItemCorrelation.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/ItemCorrelation.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/ItemCorrelation.java Fri May 9 14:35:12 2008
@@ -0,0 +1,44 @@
+/**
+ * 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.cf.taste.correlation;
+
+import org.apache.mahout.cf.taste.common.Refreshable;
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.model.Item;
+
+/**
+ * <p>Implementations of this interface define a notion of itemCorrelation between two
+ * {@link org.apache.mahout.cf.taste.model.Item}s. Implementations should return values in the range -1.0 to 1.0, with
+ * 1.0 representing perfect correlation.</p>
+ *
+ * @see UserCorrelation
+ */
+public interface ItemCorrelation extends Refreshable {
+
+ /**
+ * <p>Returns the "itemCorrelation", or degree of similarity, of two {@link org.apache.mahout.cf.taste.model.Item}s, based
+ * on the preferences that {@link org.apache.mahout.cf.taste.model.User}s have expressed for the items.</p>
+ *
+ * @param item1 first item
+ * @param item2 second item
+ * @return itemCorrelation between the {@link org.apache.mahout.cf.taste.model.Item}s
+ * @throws TasteException if an error occurs while accessing the data
+ */
+ double itemCorrelation(Item item1, Item item2) throws TasteException;
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/PreferenceInferrer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/PreferenceInferrer.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/PreferenceInferrer.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/PreferenceInferrer.java Fri May 9 14:35:12 2008
@@ -0,0 +1,42 @@
+/**
+ * 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.cf.taste.correlation;
+
+import org.apache.mahout.cf.taste.common.Refreshable;
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.model.Item;
+import org.apache.mahout.cf.taste.model.User;
+
+/**
+ * <p>Implementations of this interface compute an inferred preference for a {@link User} and an {@link Item}
+ * that the user has not expressed any preference for. This might be an average of other preferences scores
+ * from that user, for example. This technique is sometimes called "default voting".</p>
+ */
+public interface PreferenceInferrer extends Refreshable {
+
+ /**
+ * <p>Infers the given {@link User}'s preference value for an {@link Item}.</p>
+ *
+ * @param user {@link User} to infer preference for
+ * @param item {@link Item} to infer preference for
+ * @return inferred preference
+ * @throws TasteException if an error occurs while inferring
+ */
+ double inferPreference(User user, Item item) throws TasteException;
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/UserCorrelation.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/UserCorrelation.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/UserCorrelation.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/correlation/UserCorrelation.java Fri May 9 14:35:12 2008
@@ -0,0 +1,51 @@
+/**
+ * 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.cf.taste.correlation;
+
+import org.apache.mahout.cf.taste.common.Refreshable;
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.model.User;
+
+/**
+ * <p>Implementations of this interface define a notion of itemCorrelation between two
+ * {@link User}s. Implementations should return values in the range -1.0 to 1.0, with
+ * 1.0 representing perfect correlation.</p>
+ *
+ * @see ItemCorrelation
+ */
+public interface UserCorrelation extends Refreshable {
+
+ /**
+ * <p>Returns the "itemCorrelation", or degree of similarity, of two {@link User}s, based
+ * on the their preferences.</p>
+ *
+ * @param user1 first user
+ * @param user2 second user
+ * @return itemCorrelation between the two users
+ * @throws TasteException if an error occurs while accessing the data
+ */
+ double userCorrelation(User user1, User user2) throws TasteException;
+
+ /**
+ * <p>Attaches a {@link PreferenceInferrer} to the {@link UserCorrelation} implementation.</p>
+ *
+ * @param inferrer {@link PreferenceInferrer}
+ */
+ void setPreferenceInferrer(PreferenceInferrer inferrer);
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJB.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJB.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJB.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJB.java Fri May 9 14:35:12 2008
@@ -0,0 +1,67 @@
+/**
+ * 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.cf.taste.ejb;
+
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.model.Item;
+import org.apache.mahout.cf.taste.recommender.Rescorer;
+
+import javax.ejb.EJBObject;
+import java.rmi.RemoteException;
+import java.util.List;
+
+/**
+ * <p>Recommender EJB component interface.</p>
+ *
+ * @see RecommenderEJBLocal
+ * @see org.apache.mahout.cf.taste.recommender.Recommender
+ */
+public interface RecommenderEJB extends EJBObject {
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#recommend(Object, int)
+ */
+ List<Item> recommend(Object userID, int howMany) throws TasteException, RemoteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#recommend(Object, int, org.apache.mahout.cf.taste.recommender.Rescorer)
+ */
+ List<Item> recommend(Object userID, int howMany, Rescorer<Item> rescorer) throws TasteException, RemoteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#estimatePreference(Object, Object)
+ */
+ double estimatePreference(Object userID, Object itemID) throws TasteException, RemoteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#setPreference(Object, Object, double)
+ */
+ void setPreference(Object userID, Object itemID, double value)
+ throws TasteException, RemoteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#removePreference(Object, Object)
+ */
+ void removePreference(Object userID, Object itemID) throws TasteException, RemoteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#refresh()
+ */
+ void refresh();
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBBean.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBBean.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBBean.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBBean.java Fri May 9 14:35:12 2008
@@ -0,0 +1,127 @@
+/**
+ * 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.cf.taste.ejb;
+
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.model.Item;
+import org.apache.mahout.cf.taste.recommender.RecommendedItem;
+import org.apache.mahout.cf.taste.recommender.Recommender;
+import org.apache.mahout.cf.taste.recommender.Rescorer;
+
+import javax.ejb.CreateException;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.List;
+
+/**
+ * <p>Recommender EJB bean implementation.</p>
+ *
+ * <p>This class exposes a subset of the {@link Recommender} API. In particular it
+ * does not support {@link Recommender#getDataModel()}
+ * since it doesn't make sense to access this via an EJB component.</p>
+ */
+public class RecommenderEJBBean implements SessionBean {
+
+ private Recommender recommender;
+
+ public List<RecommendedItem> recommend(Object userID, int howMany) throws TasteException {
+ return recommender.recommend(userID, howMany);
+ }
+
+ public List<RecommendedItem> recommend(Object userID, int howMany, Rescorer<Item> rescorer)
+ throws TasteException {
+ return recommender.recommend(userID, howMany, rescorer);
+ }
+
+
+ public double estimatePreference(Object userID, Object itemID) throws TasteException {
+ return recommender.estimatePreference(userID, itemID);
+ }
+
+ public void setPreference(Object userID, Object itemID, double value) throws TasteException {
+ recommender.setPreference(userID, itemID, value);
+ }
+
+ public void removePreference(Object userID, Object itemID) throws TasteException {
+ recommender.removePreference(userID, itemID);
+ }
+
+ public void refresh() {
+ recommender.refresh();
+ }
+
+ public void setSessionContext(SessionContext sessionContext) {
+ // Do nothing
+ }
+
+ public void ejbCreate() throws CreateException {
+ Context ctx = null;
+ try {
+
+ ctx = new InitialContext();
+ String recommenderClassName = (String) ctx.lookup("java:comp/env/recommender-class");
+ if (recommenderClassName == null) {
+ String recommenderJNDIName = (String) ctx.lookup("java:comp/env/recommender-jndi-name");
+ if (recommenderJNDIName == null) {
+ throw new CreateException("recommender-class and recommender-jndi-name env-entry not defined");
+ }
+ recommender = (Recommender) ctx.lookup("java:comp/env/" + recommenderJNDIName);
+ } else {
+ recommender = Class.forName(recommenderClassName).asSubclass(Recommender.class).newInstance();
+ }
+
+ } catch (NamingException ne) {
+ throw new CreateException(ne.toString());
+ } catch (ClassNotFoundException cnfe) {
+ throw new CreateException(cnfe.toString());
+ } catch (InstantiationException ie) {
+ throw new CreateException(ie.toString());
+ } catch (IllegalAccessException iae) {
+ throw new CreateException(iae.toString());
+ } finally {
+ if (ctx != null) {
+ try {
+ ctx.close();
+ } catch (NamingException ne) {
+ throw new CreateException(ne.toString());
+ }
+ }
+ }
+ }
+
+ public void ejbRemove() {
+ // Do nothing
+ }
+
+ public void ejbActivate() {
+ // Do nothing: stateless session beans are not passivated/activated
+ }
+
+ public void ejbPassivate() {
+ // Do nothing: stateless session beans are not passivated/activated
+ }
+
+ @Override
+ public String toString() {
+ return "RecommenderEJBBean[recommender:" + recommender + ']';
+ }
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBHome.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBHome.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBHome.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBHome.java Fri May 9 14:35:12 2008
@@ -0,0 +1,33 @@
+/**
+ * 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.cf.taste.ejb;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+import java.rmi.RemoteException;
+
+/**
+ * <p>Recommender EJB home interface.</p>
+ *
+ * @see RecommenderEJBLocalHome
+ */
+public interface RecommenderEJBHome extends EJBHome {
+
+ RecommenderEJB create() throws RemoteException, CreateException;
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocal.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocal.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocal.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocal.java Fri May 9 14:35:12 2008
@@ -0,0 +1,65 @@
+/**
+ * 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.cf.taste.ejb;
+
+import org.apache.mahout.cf.taste.common.TasteException;
+import org.apache.mahout.cf.taste.model.Item;
+import org.apache.mahout.cf.taste.recommender.Rescorer;
+
+import javax.ejb.EJBLocalObject;
+import java.util.List;
+
+/**
+ * <p>Recommender EJB local component interface.</p>
+ *
+ * @see RecommenderEJB
+ * @see org.apache.mahout.cf.taste.recommender.Recommender
+ */
+public interface RecommenderEJBLocal extends EJBLocalObject {
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#recommend(Object, int)
+ */
+ List<Item> recommend(Object userID, int howMany) throws TasteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#recommend(Object, int, Rescorer)
+ */
+ List<Item> recommend(Object userID, int howMany, Rescorer<Item> rescorer) throws TasteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#estimatePreference(Object, Object)
+ */
+ double estimatePreference(Object userID, Object itemID) throws TasteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#setPreference(Object, Object, double)
+ */
+ void setPreference(Object userID, Object itemID, double value) throws TasteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#removePreference(Object, Object)
+ */
+ void removePreference(Object userID, Object itemID) throws TasteException;
+
+ /**
+ * @see org.apache.mahout.cf.taste.recommender.Recommender#refresh()
+ */
+ void refresh();
+
+}
Added: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocalHome.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocalHome.java?rev=654943&view=auto
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocalHome.java (added)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/ejb/RecommenderEJBLocalHome.java Fri May 9 14:35:12 2008
@@ -0,0 +1,32 @@
+/**
+ * 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.cf.taste.ejb;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBLocalHome;
+
+/**
+ * <p>Recommender EJB local home interface.</p>
+ *
+ * @see RecommenderEJBHome
+ */
+public interface RecommenderEJBLocalHome extends EJBLocalHome {
+
+ RecommenderEJBLocal create() throws CreateException;
+
+}