C# Class MyMediaLite.Eval.Items

Evaluation class for item recommendation
Show file Open project: zenogantner/MML-KDD

Public Methods

Method Description
AUC ( int ranked_items, ICollection correct_items ) : double

Compute the area under the ROC curve (AUC) of a list of ranked items

AUC ( int ranked_items, ICollection correct_items, ICollection ignore_items ) : double

Compute the area under the ROC curve (AUC) of a list of ranked items

DisplayResults ( double>.Dictionary result ) : void

Display item prediction results

Evaluate ( IItemRecommender recommender, IPosOnlyFeedback test, IPosOnlyFeedback train, ICollection relevant_users, ICollection relevant_items ) : double>.Dictionary

Evaluation for rankings of items

User-item combinations that appear in both sets are ignored for the test set, and thus in the evaluation. The evaluation measures are listed in the ItemPredictionMeasures 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

EvaluateOnline ( IItemRecommender recommender, IPosOnlyFeedback test, IPosOnlyFeedback train, ICollection relevant_users, ICollection relevant_items ) : double>.Dictionary

Online evaluation for rankings of items

MAP ( int ranked_items, ICollection correct_items ) : double

Compute the mean average precision (MAP) of a list of ranked items

MAP ( int ranked_items, ICollection correct_items, ICollection ignore_items ) : double

Compute the mean average precision (MAP) of a list of ranked items

NDCG ( int ranked_items, ICollection correct_items ) : double

Compute the normalized discounted cumulative gain (NDCG) of a list of ranked items

NDCG ( int ranked_items, ICollection correct_items, ICollection ignore_items ) : double

Compute the normalized discounted cumulative gain (NDCG) of a list of ranked items

PrecisionAt ( int ranked_items, ICollection correct_items, ICollection ignore_items, int n ) : double

Compute the precision@N of a list of ranked items

PrecisionAt ( int ranked_items, ICollection correct_items, int n ) : double

Compute the precision@N of a list of ranked items

Private Methods

Method Description
ComputeIDCG ( int n ) : double

Computes the ideal DCG given the number of positive items.

Method Details

AUC() public static method

Compute the area under the ROC curve (AUC) of a list of ranked items
public static AUC ( int ranked_items, ICollection correct_items ) : double
ranked_items int a list of ranked item IDs, the highest-ranking item first
correct_items ICollection a collection of positive/correct item IDs
return double

AUC() public static method

Compute the area under the ROC curve (AUC) of a list of ranked items
public static AUC ( int ranked_items, ICollection correct_items, ICollection ignore_items ) : double
ranked_items int a list of ranked item IDs, the highest-ranking item first
correct_items ICollection a collection of positive/correct item IDs
ignore_items ICollection a collection of item IDs which should be ignored for the evaluation
return double

DisplayResults() public static method

Display item prediction results
public static DisplayResults ( double>.Dictionary result ) : void
result double>.Dictionary the result dictionary
return void

Evaluate() public static method

Evaluation for rankings of items
User-item combinations that appear in both sets are ignored for the test set, and thus in the evaluation. The evaluation measures are listed in the ItemPredictionMeasures 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
public static Evaluate ( IItemRecommender recommender, IPosOnlyFeedback test, IPosOnlyFeedback train, ICollection relevant_users, ICollection relevant_items ) : double>.Dictionary
recommender IItemRecommender item recommender
test IPosOnlyFeedback test cases
train IPosOnlyFeedback training data
relevant_users ICollection a collection of integers with all relevant users
relevant_items ICollection a collection of integers with all relevant items
return double>.Dictionary

EvaluateOnline() public static method

Online evaluation for rankings of items
public static EvaluateOnline ( IItemRecommender recommender, IPosOnlyFeedback test, IPosOnlyFeedback train, ICollection relevant_users, ICollection relevant_items ) : double>.Dictionary
recommender IItemRecommender item recommender
test IPosOnlyFeedback test cases
train IPosOnlyFeedback training data (must be connected to the recommender's training data)
relevant_users ICollection a collection of integers with all relevant users
relevant_items ICollection a collection of integers with all relevant items
return double>.Dictionary

MAP() public static method

Compute the mean average precision (MAP) of a list of ranked items
public static MAP ( int ranked_items, ICollection correct_items ) : double
ranked_items int a list of ranked item IDs, the highest-ranking item first
correct_items ICollection a collection of positive/correct item IDs
return double

MAP() public static method

Compute the mean average precision (MAP) of a list of ranked items
public static MAP ( int ranked_items, ICollection correct_items, ICollection ignore_items ) : double
ranked_items int a list of ranked item IDs, the highest-ranking item first
correct_items ICollection a collection of positive/correct item IDs
ignore_items ICollection a collection of item IDs which should be ignored for the evaluation
return double

NDCG() public static method

Compute the normalized discounted cumulative gain (NDCG) of a list of ranked items
public static NDCG ( int ranked_items, ICollection correct_items ) : double
ranked_items int a list of ranked item IDs, the highest-ranking item first
correct_items ICollection a collection of positive/correct item IDs
return double

NDCG() public static method

Compute the normalized discounted cumulative gain (NDCG) of a list of ranked items
public static NDCG ( int ranked_items, ICollection correct_items, ICollection ignore_items ) : double
ranked_items int a list of ranked item IDs, the highest-ranking item first
correct_items ICollection a collection of positive/correct item IDs
ignore_items ICollection a collection of item IDs which should be ignored for the evaluation
return double

PrecisionAt() public static method

Compute the precision@N of a list of ranked items
public static PrecisionAt ( int ranked_items, ICollection correct_items, ICollection ignore_items, int n ) : double
ranked_items int a list of ranked item IDs, the highest-ranking item first
correct_items ICollection a collection of positive/correct item IDs
ignore_items ICollection a collection of item IDs which should be ignored for the evaluation
n int the cutoff position in the list
return double

PrecisionAt() public static method

Compute the precision@N of a list of ranked items
public static PrecisionAt ( int ranked_items, ICollection correct_items, int n ) : double
ranked_items int a list of ranked item IDs, the highest-ranking item first
correct_items ICollection a collection of positive/correct item IDs
n int the cutoff position in the list
return double