topn {lago} | R Documentation |
Reports the number of hits among the top-n ranked items.
## use default LAGO to rank items obj <- sLago(Y,X) s <- rank.sLago(obj,Xnew) ## evaluate its performance by average precision topn(y=Ynew, phat=s, n=10)
y |
a vector of binary responses. |
phat |
a vector of rankings. Often, one may want to use posterior probabilities to rank items, but any monotonic transformation of posterior probabilities will, of course, give the same ranking. |
n |
an integer indicating how many top ranked items to evaluate. |
Mu Zhu, University of Waterloo, Canada.