if (history == null) {
baseline.score(user, items);
} else {
MutableSparseVector vec = summarizer.summarize(history).mutableCopy();
// score everything, both rated and not, for offsets
LongSet allItems = LongUtils.setUnion(vec.keySet(), items.keyDomain());
MutableSparseVector baseScores = MutableSparseVector.create(allItems);
baseline.score(user, baseScores);
// subtract scores from ratings, yielding offsets
vec.subtract(baseScores);
double meanOffset = vec.sum() / (vec.size() + damping);