org.apache.mahout.cf.taste.hadoop.item
Class RecommenderJob

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.mahout.common.AbstractJob
          extended by org.apache.mahout.cf.taste.hadoop.item.RecommenderJob
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool

public final class RecommenderJob
extends AbstractJob

Runs a completely distributed recommender job as a series of mapreduces.

Preferences in the input file should look like userID, itemID[, preferencevalue]

Preference value is optional to accommodate applications that have no notion of a preference value (that is, the user simply expresses a preference for an item, but no degree of preference).

The preference value is assumed to be parseable as a double. The user IDs and item IDs are parsed as longs.

Command line arguments specific to this class are:

  1. --input(path): Directory containing one or more text files with the preference data
  2. --output(path): output path where recommender output should go
  3. --similarityClassname (classname): Name of vector similarity class to instantiate or a predefined similarity from VectorSimilarityMeasure
  4. --usersFile (path): only compute recommendations for user IDs contained in this file (optional)
  5. --itemsFile (path): only include item IDs from this file in the recommendations (optional)
  6. --filterFile (path): file containing comma-separated userID,itemID pairs. Used to exclude the item from the recommendations for that user (optional)
  7. --numRecommendations (integer): Number of recommendations to compute per user (10)
  8. --booleanData (boolean): Treat input data as having no pref values (false)
  9. --maxPrefsPerUser (integer): Maximum number of preferences considered per user in final recommendation phase (10)
  10. --maxSimilaritiesPerItem (integer): Maximum number of similarities considered per item (100)
  11. --minPrefsPerUser (integer): ignore users with less preferences than this in the similarity computation (1)
  12. --maxPrefsPerUserInItemSimilarity (integer): max number of preferences to consider per user in the item similarity computation phase, users with more preferences will be sampled down (1000)
  13. --threshold (double): discard item pairs with a similarity value below this

General command line options are documented in AbstractJob.

Note that because of how Hadoop parses arguments, all "-D" arguments must appear before all other arguments.


Field Summary
static String BOOLEAN_DATA
           
static String DEFAULT_PREPARE_PATH
           
 
Fields inherited from class org.apache.mahout.common.AbstractJob
argMap, inputFile, inputPath, outputFile, outputPath, tempPath
 
Constructor Summary
RecommenderJob()
           
 
Method Summary
static void main(String[] args)
           
 int run(String[] args)
           
 
Methods inherited from class org.apache.mahout.common.AbstractJob
addFlag, addInputOption, addOption, addOption, addOption, addOption, addOutputOption, buildOption, buildOption, getAnalyzerClassFromOption, getCLIOption, getConf, getDimensions, getFloat, getFloat, getGroup, getInputFile, getInputPath, getInt, getInt, getOption, getOption, getOption, getOptions, getOutputFile, getOutputPath, getOutputPath, getTempPath, getTempPath, hasOption, keyFor, maybePut, parseArguments, parseArguments, parseDirectories, prepareJob, prepareJob, prepareJob, prepareJob, setConf, setS3SafeCombinedInputPath, shouldRunNextPhase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOLEAN_DATA

public static final String BOOLEAN_DATA
See Also:
Constant Field Values

DEFAULT_PREPARE_PATH

public static final String DEFAULT_PREPARE_PATH
See Also:
Constant Field Values
Constructor Detail

RecommenderJob

public RecommenderJob()
Method Detail

run

public int run(String[] args)
        throws Exception
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.