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 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 double PrecisionAt (IList< int > ranked_items, ICollection< int > correct_items, int n)
 Compute the precision 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 RecallAt (IList< int > ranked_items, ICollection< int > correct_items, ICollection< int > ignore_items, int n)
 Compute the recall of a list of ranked items.
static double RecallAt (IList< int > ranked_items, ICollection< int > correct_items, int n)
 Compute the recall 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.

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.

Parameters:
ranked_items a list of ranked item IDs, the highest-ranking item first
correct_items a collection of positive/correct item IDs
ignore_items a 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_items a list of ranked item IDs, the highest-ranking item first
correct_items a collection of positive/correct item IDs
ignore_items a collection of item IDs which should be ignored for the evaluation
n the cutoff position in the list
Returns:
the hits 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_items a list of ranked item IDs, the highest-ranking item first
correct_items a collection of positive/correct item IDs
ignore_items a collection of item IDs which should be ignored for the evaluation
n the cutoff position in the list
Returns:
the precision for the given data
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_items a list of ranked item IDs, the highest-ranking item first
correct_items a collection of positive/correct item IDs
n the cutoff position in the list
Returns:
the precision 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_items a list of ranked item IDs, the highest-ranking item first
correct_items a collection of positive/correct item IDs
ignore_items a collection of item IDs which should be ignored for the evaluation
ns the cutoff positions in the list
Returns:
the precision for the given data at the different positions N
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_items a list of ranked item IDs, the highest-ranking item first
correct_items a collection of positive/correct item IDs
ignore_items a collection of item IDs which should be ignored for the evaluation
n the cutoff position in the list
Returns:
the recall for the given data
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_items a list of ranked item IDs, the highest-ranking item first
correct_items a collection of positive/correct item IDs
n the cutoff position in the list
Returns:
the recall 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_items a list of ranked item IDs, the highest-ranking item first
correct_items a collection of positive/correct item IDs
ignore_items a collection of item IDs which should be ignored for the evaluation
ns the cutoff positions in the list
Returns:
the recall for the given data at the different positions N

The documentation for this class was generated from the following file:
Generated on Thu Apr 5 01:11:32 2012 for MyMediaLite by  doxygen 1.6.3