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 2009/04/07 08:20:44 UTC

svn commit: r762634 - in /lucene/mahout: site/src/documentation/content/xdocs/ trunk/taste-web/src/main/resources/org/ trunk/taste-web/src/main/resources/org/apache/ trunk/taste-web/src/main/resources/org/apache/mahout/ trunk/taste-web/src/main/resourc...

Author: srowen
Date: Tue Apr  7 06:20:43 2009
New Revision: 762634

URL: http://svn.apache.org/viewvc?rev=762634&view=rev
Log:
Updated documentation per discussion list, fixing some steps in the example build process

Added:
    lucene/mahout/trunk/taste-web/src/main/resources/org/
    lucene/mahout/trunk/taste-web/src/main/resources/org/apache/
    lucene/mahout/trunk/taste-web/src/main/resources/org/apache/mahout/
    lucene/mahout/trunk/taste-web/src/main/resources/org/apache/mahout/cf/
    lucene/mahout/trunk/taste-web/src/main/resources/org/apache/mahout/cf/taste/
    lucene/mahout/trunk/taste-web/src/main/resources/org/apache/mahout/cf/taste/example/
    lucene/mahout/trunk/taste-web/src/main/resources/org/apache/mahout/cf/taste/example/grouplens/
Modified:
    lucene/mahout/site/src/documentation/content/xdocs/taste.xml

Modified: lucene/mahout/site/src/documentation/content/xdocs/taste.xml
URL: http://svn.apache.org/viewvc/lucene/mahout/site/src/documentation/content/xdocs/taste.xml?rev=762634&r1=762633&r2=762634&view=diff
==============================================================================
--- lucene/mahout/site/src/documentation/content/xdocs/taste.xml (original)
+++ lucene/mahout/site/src/documentation/content/xdocs/taste.xml Tue Apr  7 06:20:43 2009
@@ -93,7 +93,7 @@
 <section><title>Required</title>
 
 <ul>
- <li><a href="http://java.sun.com/j2se/1.5.0/index.jsp">Java / J2SE 5.0</a></li>
+ <li><a href="http://java.sun.com/j2se/1.5.0/index.jsp">Java / J2SE 6.0</a></li>
 </ul>
 
 </section>
@@ -101,8 +101,9 @@
 <section><title>Optional</title>
 
 <ul>
- <li><a href="http://ant.apache.org/">Apache Ant</a> 1.5 or later,
-  if you want to build from source or build examples.</li>
+ <li><a href="http://ant.apache.org/">Apache Ant</a> 1.5 or later and <a href="http://maven.apache.org">Maven</a>
+  2.0.10 or later, if you want to build from source or build examples. (Mac users note that even OS X 10.5
+  ships with Maven 2.0.6, which will not work.)</li>
  <li>Taste web applications require a <a href="http://java.sun.com/products/servlet/index.jsp">Servlet 2.3+</a>
   container, such as
   <a href="http://jakarta.apache.org/tomcat/">Jakarta Tomcat</a>. It may in fact work with older
@@ -122,19 +123,21 @@
 <p>To build and run the demo, follow the instructions below, which are written for Unix-like operating systems:</p>
 
 <ol>
+  <li>Obtain a copy of the Mahout distribution, either from SVN or as a downloaded archive.</li>
   <li>Download the "1 Million MovieLens Dataset" from
    <a href="http://www.grouplens.org/">http://www.grouplens.org/</a>.</li>
-
   <li>Unpack the archive and copy <code>movies.dat</code> and <code>ratings.dat</code> to
    <code>trunk/taste-web/src/main/resources/org/apache/mahout/cf/taste/example/grouplens</code> under the Mahout distribution
    directory.</li>
   <li>Navigate to the directory where you unpacked the Mahout distribution, and navigate to <code>trunk</code>.</li>
-  <li>mvn install -- Install Mahout core to your local repository</li>
-  <li>cd taste-web</li>
-  <li>cp ../examples/target/grouplens.jar ./lib -- If you are using a different recommender, just add it to the lib directory</li>
-  <li>Edit recommender.properties and fill in the recommender.class value with the GroupLensRecommender, i.e.<ul><li>recommender.class=org.apache.mahout.cf.taste.example.grouplens.GroupLensRecommender</li></ul></li>
-  <li>mvn package</li>
-  <li>mvn jetty:run-war - You may need to give Maven more memory:  In bash shell, do export MAVEN_OPTS=-Xmx1024M</li>
+  <li>Run <code>mvn install</code>, which builds and installs Mahout core to your local repository</li>
+  <li><code>cd taste-web</code></li>
+  <li><code>cp ../examples/target/grouplens.jar ./lib</code></li>
+  <li>Edit <code>recommender.properties</code> and fill in the <code>recommender.class</code>:
+      <code>recommender.class=org.apache.mahout.cf.taste.example.grouplens.GroupLensRecommender</code>
+  </li>
+  <li><code>mvn package</code></li>
+  <li><code>mvn jetty:run-war</code>. You may need to give Maven more memory: in a bash shell, <code>export MAVEN_OPTS=-Xmx1024M</code></li>
   <li>Get recommendations by accessing the web application in your browser:<br/>
     <code>http://localhost:8080/mahout-taste-webapp/RecommenderServlet?userID=1</code><br/>
     This will produce a simple preference-item ID list which could be consumed by a client application.
@@ -160,7 +163,8 @@
 are thus suitable for small data sets (roughly, less than a million ratings). We'll start with an example of this.</p>
 
 <p>First, create a <code>DataModel</code> of some kind. Here, we'll use a simple on based
-on data in a file:</p>
+on data in a file. The file should be in CSV format, with lines of the form <code>userID,itemID,prefValue</code>
+(e.g. "AB39505,290002,3.5"):</p>
 
 <pre>DataModel model = new FileDataModel(new File("data.txt"));
 </pre>
@@ -268,12 +272,18 @@
 <p>To deploy your <code>Recommender</code> as an external server:</p>
 
 <ol>
-  <li>Create an implementation of <code>org.apache.mahout.cf.taste.recommender.Recommender</code>.</li>
-
+  <li>Obtain a copy of the Mahout distribution, either from SVN or as a downloaded archive.</li>
+  <li>Create an implementation of <code>org.apache.mahout.cf.taste.recommender.Recommender</code> (must have a no-arg constructor).</li>
   <li>Compile it and create a JAR file containing your implementation.</li>
-  <li>Build a WAR file that will run your Recommender as a web application:<br/>
-  <code>ant -Dmy-recommender.jar=yourJARfile.jar -Dmy-recommender-class=com.foo.YourRecommender build-server</code></li>
-  <li>Follow from the "Install Tomcat" step above under <a href="#demo">Demo</a>.</li>
+  <li>Navigate to the directory where you unpacked the Mahout distribution, and navigate to <code>trunk</code>.</li>
+  <li>Run <code>mvn install</code>, which builds and installs Mahout core to your local repository</li>
+  <li><code>cd taste-web</code></li>
+  <li>Copy your .jar file: <code>cp [your .jar file] ./lib</code></li>
+  <li>Edit <code>recommender.properties</code> and fill in the <code>recommender.class</code> with your Recommender clas:
+      <code>recommender.class=[your recommender class]</code>
+  </li>
+  <li><code>mvn package</code></li>
+  <li>Your .war file is now available in the build directory as <code>mahout-taste-webapp.war</code> (which can be renamed).</li>
 </ol>
 
 </section>