ap_k
calculates Average Precision at K (ap@k
).
Please refer to https://en.wikipedia.org/wiki/Information_retrieval#Average_precision
ndcg_k()
calculates Normalized Discounted Cumulative Gain at K (ndcg@k
).
Please refer to https://en.wikipedia.org/wiki/Discounted_cumulative_gain#Normalized_DCG
ap_k(predictions, actual, ...)ndcg_k(predictions, actual, ...)
matrix of predictions. Predctions can be defined 2 ways:
predictions
= integer
matrix with item indices (correspond to column numbers in actual
)
predictions
= character
matrix with item identifiers (characters which correspond to colnames(actual)
)
which has attribute "indices" (integer
matrix with item indices which correspond to column numbers in actual
).
sparse Matrix of relevant items. Each non-zero entry considered as relevant item.
Value of the each non-zero entry considered as relevance for calculation of ndcg@k
.
It should inherit from Matrix::sparseMatrix
. Internally Matrix::RsparseMatrix
is used.
other arguments (not used at the moment)