MyMediaLite  3.11
Static Public Member Functions | Properties | List of all members
Items Class Reference

Evaluation class for item recommendation More...

Static Public Member Functions

static IList< int > Candidates (IList< int > candidate_items, CandidateItems candidate_item_mode, IPosOnlyFeedback test, IPosOnlyFeedback training)
 
static double ComputeFit (this ItemRecommender recommender, IList< int > test_users=null, IList< int > candidate_items=null, CandidateItems candidate_item_mode=CandidateItems.OVERLAP)
 Computes the AUC fit of a recommender on the training data More...
 
static ItemRecommendationEvaluationResults Evaluate (this IRecommender recommender, IPosOnlyFeedback test, IPosOnlyFeedback training, IList< int > test_users=null, IList< int > candidate_items=null, CandidateItems candidate_item_mode=CandidateItems.OVERLAP, RepeatedEvents repeated_events=RepeatedEvents.No, int n=-1)
 Evaluation for rankings of items More...
 

Properties

static ICollection< string > Measures [get]
 the evaluation measures for item prediction offered by the class More...
 

Detailed Description

Evaluation class for item recommendation

Member Function Documentation

static IList<int> Candidates ( IList< int >  candidate_items,
CandidateItems  candidate_item_mode,
IPosOnlyFeedback  test,
IPosOnlyFeedback  training 
)
inlinestatic
Parameters
candidate_itemsa list of integers with all candidate items
candidate_item_modethe mode used to determine the candidate items
testtest cases
trainingtraining data
static double ComputeFit ( this ItemRecommender  recommender,
IList< int >  test_users = null,
IList< int >  candidate_items = null,
CandidateItems  candidate_item_mode = CandidateItems.OVERLAP 
)
inlinestatic

Computes the AUC fit of a recommender on the training data

Returns
the AUC on the training data
Parameters
recommenderthe item recommender to evaluate
test_usersa list of integers with all test users; if null, use all users in the test cases
candidate_itemsa list of integers with all candidate items
candidate_item_modethe mode used to determine the candidate items
static ItemRecommendationEvaluationResults Evaluate ( this IRecommender  recommender,
IPosOnlyFeedback  test,
IPosOnlyFeedback  training,
IList< int >  test_users = null,
IList< int >  candidate_items = null,
CandidateItems  candidate_item_mode = CandidateItems.OVERLAP,
RepeatedEvents  repeated_events = RepeatedEvents.No,
int  n = -1 
)
inlinestatic

Evaluation for rankings of items

User-item combinations that appear in both sets are ignored for the test set, and thus in the evaluation, except the boolean argument repeated_events is set.

The evaluation measures are listed in the Measures property. Additionally, 'num_users' and 'num_items' report the number of users that were used to compute the results and the number of items that were taken into account.

Literature:

  • C. Manning, P. Raghavan, H. Schütze: Introduction to Information Retrieval, Cambridge University Press, 2008

On multi-core/multi-processor systems, the routine tries to use as many cores as possible, which should to an almost linear speed-up.

Parameters
recommenderitem recommender
testtest cases
trainingtraining data
test_usersa list of integers with all test users; if null, use all users in the test cases
candidate_itemsa list of integers with all candidate items
candidate_item_modethe mode used to determine the candidate items
repeated_eventsallow repeated events in the evaluation (i.e. items accessed by a user before may be in the recommended list)
nlength of the item list to evaluate – if set to -1 (default), use the complete list, otherwise compute evaluation measures on the top n items
Returns
a dictionary containing the evaluation results (default is false)

Property Documentation

ICollection<string> Measures
staticget

the evaluation measures for item prediction offered by the class

The evaluation measures currently are:

  • AUCarea under the ROC curve
  • prec@5precision at 5
  • prec@10precision at 10
  • MAPmean average precision
  • recall@5recall at 5
  • recall@10recall at 10
  • NDCGnormalizad discounted cumulative gain
  • MRRmean reciprocal rank

An item recommender is better than another according to one of those measures its score is higher.


The documentation for this class was generated from the following file: