for (Song s : songs) {
// forall neighborhood_i Union items_rated_by_user(active) item
double numerator = 0, denominator = 0, predictedRating;
for (Song ratedByActive : active.getRatings()) {
if (s.getNeighborhood().contains(ratedByActive) && !active.rated(s)) {
Song rba = songs.getSong(ratedByActive.getID());
double similarity = rba.getSimilarity(s);
// numerator += math ... similarity(i, item) * active.rating(item) …
numerator += similarity * active.getRating(rba);
// denominator += |similarity(i, item)|
denominator += Math.abs(similarity);
}