Long2ObjectMap<ScoredIdListBuilder> itemRatingData = new Long2ObjectOpenHashMap<ScoredIdListBuilder>(1000);
Long2ObjectMap<LongSortedSet> userItems = new Long2ObjectOpenHashMap<LongSortedSet>(1000);
buildItemRatings(itemRatingData, userItems);
LongKeyDomain items = LongKeyDomain.fromCollection(itemRatingData.keySet(), true);
final int n = items.domainSize();
assert n == itemRatingData.size();
// finalize the item data into vectors
SparseVector[] itemRatings = new SparseVector[n];
for (int i = 0; i < n; i++) {