MyMediaLite
3.09
|
Precision and recall at different positions in the list. More...
Static Public Member Functions | |
static double | AP (IList< int > ranked_items, ICollection< int > correct_items) |
Compute the average precision (AP) of a list of ranked items. | |
static int | HitsAt (IList< int > ranked_items, ICollection< int > correct_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, IList< int > ns) |
Compute the precision at N 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 at N of a list of ranked items. | |
static Dictionary< int, double > | RecallAt (IList< int > ranked_items, ICollection< int > correct_items, IList< int > ns) |
Compute the recall at N 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 at N of a list of ranked items. |
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)
static double AP | ( | IList< int > | ranked_items, |
ICollection< int > | correct_items | ||
) | [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.
ranked_items | a list of ranked item IDs, the highest-ranking item first |
correct_items | a collection of positive/correct item IDs |
static int HitsAt | ( | IList< int > | ranked_items, |
ICollection< int > | correct_items, | ||
int | n | ||
) | [inline, static] |
Compute the number of hits until position N of a list of ranked items.
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 |
static Dictionary<int, double> PrecisionAt | ( | IList< int > | ranked_items, |
ICollection< int > | correct_items, | ||
IList< int > | ns | ||
) | [inline, static] |
Compute the precision at N of a list of ranked items at several N.
ranked_items | a list of ranked item IDs, the highest-ranking item first |
correct_items | a collection of positive/correct item IDs |
ns | the cutoff positions in the list |
static double PrecisionAt | ( | IList< int > | ranked_items, |
ICollection< int > | correct_items, | ||
int | n | ||
) | [inline, static] |
Compute the precision at N of a list of ranked items.
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 |
static Dictionary<int, double> RecallAt | ( | IList< int > | ranked_items, |
ICollection< int > | correct_items, | ||
IList< int > | ns | ||
) | [inline, static] |
Compute the recall at N of a list of ranked items at several N.
ranked_items | a list of ranked item IDs, the highest-ranking item first |
correct_items | a collection of positive/correct item IDs |
ns | the cutoff positions in the list |
static double RecallAt | ( | IList< int > | ranked_items, |
ICollection< int > | correct_items, | ||
int | n | ||
) | [inline, static] |
Compute the recall at N of a list of ranked items.
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 |