LongList items = new LongArrayList(recs.size());
for (ScoredId sid: recs) {
items.add(sid.getId());
}
SparseVector scores = scorer.score(user, items);
ScoredIdListBuilder builder = ScoredIds.newListBuilder(recs.size());
builder.addChannel(ORIGINAL_SCORE_SYMBOL);
for (ScoredId sid: recs) {
// FIXME Make this not allocate so much memory
builder.add(ScoredIds.copyBuilder(sid)
.setScore(scores.get(sid.getId(), Double.NaN))
.addChannel(ORIGINAL_SCORE_SYMBOL, sid.getScore())
.build());
}
return builder.build();
}