Apache Lucene Mahout > index > QuickStart > TasteCommandLine
Added by Isabel Drost, last edited by Isabel Drost on Oct 09, 2009

Introduction

This quick start page describes how to run the hadoop based recommendation jobs of Mahout Taste on a Hadoop cluster.

Steps

Testing it on one single machine w/o cluster

In the examples directory type:

 
mvn -q exec:java -Dexec.mainClass="org.apache.mahout.cf.taste.hadoop.SlopeOneDiffsAveragesJob" -Dexec.args="<OPTIONS>" 
mvn -q exec:java -Dexec.mainClass="org.apache.mahout.cf.taste.hadoop.SlopeOnePrefsToDiffsJob" -Dexec.args="<OPTIONS>" 
mvn -q exec:java -Dexec.mainClass="org.apache.mahout.cf.taste.hadoop.RecommenderJob" -Dexec.args="<OPTIONS>" 

Running it on the cluster

  • In $MAHOUT_HOME/, build the jar containing the job (mvn install) The job will be generated in $MAHOUT_HOME/core/target/ and it's name will contain the Mahout version number. For example, when using Mahout 0.1 release, the job will be mahout-core-0.1.jar
  • (Optional) 1 Start up Hadoop: $HADOOP_HOME/bin/start-all.sh
  • Put the data: $HADOOP_HOME/bin/hadoop fs -put <PATH TO DATA> testdata
  • Run the Job: $HADOOP_HOME/bin/hadoop jar $MAHOUT_HOME/core/target/mahout-core-<MAHOUT VERSION>.job org.apache.mahout.cf.taste.hadoop.<JOB> <OPTIONS>
  • Get the data out of HDFS and have a look. Use bin/hadoop fs -lsr output to view all outputs.

Command line options

 
Usage:
SlopeOneDiffsAveragesJob and SlopeOnePrefsToDiffsJob [--input <input> --output <output> --help]                                     
Options                                                                         
  --input (-i) input      The Path for input preferences file.                  
  --output (-o) output    The directory pathname for output.             
  --help (-h)             Print out help.

Usage:                                                                          
Recommender [--recommenderClassName <recommenderClassName> --userRec <userRec> --userIdFile <userIdFile> --dataModelFile <dataModelFile> --output <output> --help]                                                                         
Options                                                                         
  --recommenderClassName (-r) recommenderClassName    Name of recommender class to use.
  --userRec (-n) userRec                              Desired number of recommendations per user.
  --userIdFile (-f) userIdFile                        File containing user ids.
  --dataModelFile (-m) dataModelFile                  File containing data model.
  --output (-o) output                                The directory pathname for output.
  --help (-h)                                         Print out help.