Use generic type to represent IDs
add API to calculate precision and ndcg at each ranking position