|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mymedialite.eval.measures.PrecisionAndRecall
public class PrecisionAndRecall
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)
Method Summary | |
---|---|
static double |
AP(java.util.List<java.lang.Integer> ranked_items,
java.util.Collection<java.lang.Integer> correct_items,
java.util.Collection<java.lang.Integer> ignore_items)
Compute the average precision (AP) of a list of ranked items. |
static int |
hitsAt(java.util.List<java.lang.Integer> ranked_items,
java.util.Collection<java.lang.Integer> correct_items,
java.util.Collection<java.lang.Integer> ignore_items,
int n)
Compute the number of hits until position N of a list of ranked items. |
static double |
precisionAt(java.util.List<java.lang.Integer> ranked_items,
java.util.Collection<java.lang.Integer> correct_items,
java.util.Collection<java.lang.Integer> ignore_items,
int n)
Compute the precision@N of a list of ranked items. |
static java.util.HashMap<java.lang.Integer,java.lang.Double> |
precisionAt(java.util.List<java.lang.Integer> ranked_items,
java.util.Collection<java.lang.Integer> correct_items,
java.util.Collection<java.lang.Integer> ignore_items,
int[] ns)
Compute the precision@N of a list of ranked items at several N. |
static double |
precisionAt(java.util.List<java.lang.Integer> ranked_items,
java.util.Collection<java.lang.Integer> correct_items,
int n)
Compute the precision@N of a list of ranked items. |
static double |
recallAt(java.util.List<java.lang.Integer> ranked_items,
java.util.Collection<java.lang.Integer> correct_items,
java.util.Collection<java.lang.Integer> ignore_items,
int n)
Compute the recall@N of a list of ranked items. |
static java.util.HashMap<java.lang.Integer,java.lang.Double> |
recallAt(java.util.List<java.lang.Integer> ranked_items,
java.util.Collection<java.lang.Integer> correct_items,
java.util.Collection<java.lang.Integer> ignore_items,
int[] ns)
Compute the recall@N of a list of ranked items at several N. |
static double |
recallAt(java.util.List<java.lang.Integer> ranked_items,
java.util.Collection<java.lang.Integer> correct_items,
int n)
Compute the recall@N of a list of ranked items. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double AP(java.util.List<java.lang.Integer> ranked_items, java.util.Collection<java.lang.Integer> correct_items, java.util.Collection<java.lang.Integer> ignore_items)
ranked_items
- a list of ranked item IDs, the highest-ranking item firstcorrect_items
- a collection of positive/correct item IDsignore_items
- a collection of item IDs which should be ignored for the evaluation
public static java.util.HashMap<java.lang.Integer,java.lang.Double> precisionAt(java.util.List<java.lang.Integer> ranked_items, java.util.Collection<java.lang.Integer> correct_items, java.util.Collection<java.lang.Integer> ignore_items, int[] ns)
ranked_items
- a list of ranked item IDs, the highest-ranking item firstcorrect_items
- a collection of positive/correct item IDsignore_items
- a collection of item IDs which should be ignored for the evaluationns
- the cutoff positions in the list
public static double precisionAt(java.util.List<java.lang.Integer> ranked_items, java.util.Collection<java.lang.Integer> correct_items, int n)
ranked_items
- a list of ranked item IDs, the highest-ranking item firstcorrect_items
- a collection of positive/correct item IDsn
- the cutoff position in the list
public static double precisionAt(java.util.List<java.lang.Integer> ranked_items, java.util.Collection<java.lang.Integer> correct_items, java.util.Collection<java.lang.Integer> ignore_items, int n)
ranked_items
- a list of ranked item IDs, the highest-ranking item firstcorrect_items
- a collection of positive/correct item IDsignore_items
- a collection of item IDs which should be ignored for the evaluationn
- the cutoff position in the list
public static java.util.HashMap<java.lang.Integer,java.lang.Double> recallAt(java.util.List<java.lang.Integer> ranked_items, java.util.Collection<java.lang.Integer> correct_items, java.util.Collection<java.lang.Integer> ignore_items, int[] ns)
ranked_items
- a list of ranked item IDs, the highest-ranking item firstcorrect_items
- a collection of positive/correct item IDsignore_items
- a collection of item IDs which should be ignored for the evaluationns
- the cutoff positions in the list
public static double recallAt(java.util.List<java.lang.Integer> ranked_items, java.util.Collection<java.lang.Integer> correct_items, int n)
ranked_items
- a list of ranked item IDs, the highest-ranking item firstcorrect_items
- a collection of positive/correct item IDsn
- the cutoff position in the list
public static double recallAt(java.util.List<java.lang.Integer> ranked_items, java.util.Collection<java.lang.Integer> correct_items, java.util.Collection<java.lang.Integer> ignore_items, int n)
ranked_items
- a list of ranked item IDs, the highest-ranking item firstcorrect_items
- a collection of positive/correct item IDsignore_items
- a collection of item IDs which should be ignored for the evaluationn
- the cutoff position in the list
public static int hitsAt(java.util.List<java.lang.Integer> ranked_items, java.util.Collection<java.lang.Integer> correct_items, java.util.Collection<java.lang.Integer> ignore_items, int n)
ranked_items
- a list of ranked item IDs, the highest-ranking item firstcorrect_items
- a collection of positive/correct item IDsignore_items
- a collection of item IDs which should be ignored for the evaluationn
- the cutoff position in the list
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |