MyMediaLite  3.01
Static Public Member Functions
PrecisionAndRecall Class Reference

Precision and recall at different positions in the list. More...

List of all members.

Static Public Member Functions

static double AP (IList< int > ranked_items, ICollection< int > correct_items, ICollection< int > ignore_items=null)
 Compute the average precision (AP) of a list of ranked items.
static int HitsAt (IList< int > ranked_items, ICollection< int > correct_items, ICollection< int > ignore_items, int n)
 Compute the number of hits until position N of a list of ranked items.
static Dictionary< int, double > PrecisionAt (IList< int > ranked_items, ICollection< int > correct_items, ICollection< int > ignore_items, IList< int > ns)
 Compute the precision of a list of ranked items at several N.
static double PrecisionAt (IList< int > ranked_items, ICollection< int > correct_items, int n)
 Compute the precision of a list of ranked items.
static double PrecisionAt (IList< int > ranked_items, ICollection< int > correct_items, ICollection< int > ignore_items, int n)
 Compute the precision of a list of ranked items.
static Dictionary< int, double > RecallAt (IList< int > ranked_items, ICollection< int > correct_items, ICollection< int > ignore_items, IList< int > ns)
 Compute the recall of a list of ranked items at several N.
static double RecallAt (IList< int > ranked_items, ICollection< int > correct_items, int n)
 Compute the recall of a list of ranked items.
static double RecallAt (IList< int > ranked_items, ICollection< int > correct_items, ICollection< int > ignore_items, int n)
 Compute the recall of a list of ranked items.

Detailed Description

Precision and recall at different positions in the list.

Precision and recall are classical evaluation measures from information retrieval.

This class contains methods for computing precision and recall up to different positions in the recommendation list, and the average precision (AP).

The mean of the AP over different users is called mean average precision (MAP)


Member Function Documentation

static double AP ( IList< int >  ranked_items,
ICollection< int >  correct_items,
ICollection< int >  ignore_items = null 
) [inline, static]

Compute the average precision (AP) of a list of ranked items.

See p. 147 of Introduction to Information Retrieval by Manning, Raghavan, Schütze.

Parameters:
ranked_itemsa list of ranked item IDs, the highest-ranking item first
correct_itemsa collection of positive/correct item IDs
ignore_itemsa collection of item IDs which should be ignored for the evaluation
Returns:
the AP for the given list
static int HitsAt ( IList< int >  ranked_items,
ICollection< int >  correct_items,
ICollection< int >  ignore_items,
int  n 
) [inline, static]

Compute the number of hits until position N of a list of ranked items.

Parameters:
ranked_itemsa list of ranked item IDs, the highest-ranking item first
correct_itemsa collection of positive/correct item IDs
ignore_itemsa collection of item IDs which should be ignored for the evaluation
nthe cutoff position in the list
Returns:
the hits for the given data
static Dictionary<int, double> PrecisionAt ( IList< int >  ranked_items,
ICollection< int >  correct_items,
ICollection< int >  ignore_items,
IList< int >  ns 
) [inline, static]

Compute the precision of a list of ranked items at several N.

Parameters:
ranked_itemsa list of ranked item IDs, the highest-ranking item first
correct_itemsa collection of positive/correct item IDs
ignore_itemsa collection of item IDs which should be ignored for the evaluation
nsthe cutoff positions in the list
Returns:
the precision for the given data at the different positions N
static double PrecisionAt ( IList< int >  ranked_items,
ICollection< int >  correct_items,
int  n 
) [inline, static]

Compute the precision of a list of ranked items.

Parameters:
ranked_itemsa list of ranked item IDs, the highest-ranking item first
correct_itemsa collection of positive/correct item IDs
nthe cutoff position in the list
Returns:
the precision for the given data
static double PrecisionAt ( IList< int >  ranked_items,
ICollection< int >  correct_items,
ICollection< int >  ignore_items,
int  n 
) [inline, static]

Compute the precision of a list of ranked items.

Parameters:
ranked_itemsa list of ranked item IDs, the highest-ranking item first
correct_itemsa collection of positive/correct item IDs
ignore_itemsa collection of item IDs which should be ignored for the evaluation
nthe cutoff position in the list
Returns:
the precision for the given data
static Dictionary<int, double> RecallAt ( IList< int >  ranked_items,
ICollection< int >  correct_items,
ICollection< int >  ignore_items,
IList< int >  ns 
) [inline, static]

Compute the recall of a list of ranked items at several N.

Parameters:
ranked_itemsa list of ranked item IDs, the highest-ranking item first
correct_itemsa collection of positive/correct item IDs
ignore_itemsa collection of item IDs which should be ignored for the evaluation
nsthe cutoff positions in the list
Returns:
the recall for the given data at the different positions N
static double RecallAt ( IList< int >  ranked_items,
ICollection< int >  correct_items,
int  n 
) [inline, static]

Compute the recall of a list of ranked items.

Parameters:
ranked_itemsa list of ranked item IDs, the highest-ranking item first
correct_itemsa collection of positive/correct item IDs
nthe cutoff position in the list
Returns:
the recall for the given data
static double RecallAt ( IList< int >  ranked_items,
ICollection< int >  correct_items,
ICollection< int >  ignore_items,
int  n 
) [inline, static]

Compute the recall of a list of ranked items.

Parameters:
ranked_itemsa list of ranked item IDs, the highest-ranking item first
correct_itemsa collection of positive/correct item IDs
ignore_itemsa collection of item IDs which should be ignored for the evaluation
nthe cutoff position in the list
Returns:
the recall for the given data

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