org.apache.mahout.cf.taste.impl.eval
Class GenericRecommenderIRStatsEvaluator

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.eval.GenericRecommenderIRStatsEvaluator
All Implemented Interfaces:
RecommenderIRStatsEvaluator

public final class GenericRecommenderIRStatsEvaluator
extends Object
implements RecommenderIRStatsEvaluator

For each user, these implementation determine the top n preferences, then evaluate the IR statistics based on a DataModel that does not have these values. This number n is the "at" value, as in "precision at 5". For example, this would mean precision evaluated by removing the top 5 preferences for a user and then finding the percentage of those 5 items included in the top 5 recommendations for that user.


Field Summary
static double CHOOSE_THRESHOLD
          Pass as "relevanceThreshold" argument to evaluate(RecommenderBuilder, DataModelBuilder, DataModel, IDRescorer, int, double, double) to have it attempt to compute a reasonable threshold.
 
Constructor Summary
GenericRecommenderIRStatsEvaluator()
           
GenericRecommenderIRStatsEvaluator(RelevantItemsDataSplitter dataSplitter)
           
 
Method Summary
 IRStatistics evaluate(RecommenderBuilder recommenderBuilder, DataModelBuilder dataModelBuilder, DataModel dataModel, IDRescorer rescorer, int at, double relevanceThreshold, double evaluationPercentage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHOOSE_THRESHOLD

public static final double CHOOSE_THRESHOLD
Pass as "relevanceThreshold" argument to evaluate(RecommenderBuilder, DataModelBuilder, DataModel, IDRescorer, int, double, double) to have it attempt to compute a reasonable threshold. Note that this will impact performance.

See Also:
Constant Field Values
Constructor Detail

GenericRecommenderIRStatsEvaluator

public GenericRecommenderIRStatsEvaluator()

GenericRecommenderIRStatsEvaluator

public GenericRecommenderIRStatsEvaluator(RelevantItemsDataSplitter dataSplitter)
Method Detail

evaluate

public IRStatistics evaluate(RecommenderBuilder recommenderBuilder,
                             DataModelBuilder dataModelBuilder,
                             DataModel dataModel,
                             IDRescorer rescorer,
                             int at,
                             double relevanceThreshold,
                             double evaluationPercentage)
                      throws TasteException
Specified by:
evaluate in interface RecommenderIRStatsEvaluator
Parameters:
recommenderBuilder - object that can build a Recommender to test
dataModelBuilder - DataModelBuilder to use, or if null, a default DataModel implementation will be used
dataModel - dataset to test on
rescorer - if any, to use when computing recommendations
at - as in, "precision at 5". The number of recommendations to consider when evaluating precision, etc.
relevanceThreshold - items whose preference value is at least this value are considered "relevant" for the purposes of computations
Returns:
IRStatistics with resulting precision, recall, etc.
Throws:
TasteException - if an error occurs while accessing the DataModel


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