Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (method == Method.ITEM_SIMILARITY) {
- SimilarityTable ISim = itemNeighbors.get(item);
- int detail = numItemNeighbors;
- for (SimilarityTable.Similarity s : ISim.similarities){
- Rating r = raterData.get(rater).getRatingFor(s.key);
- if (r == null) continue;
- numer += s.predict(r.rawScore) * s.value;
- denom += s.value;
- ct++;
- if (ct >= detail) break;
- }
- if (denom != 0)
- score = numer / denom;
- else
- score = geometricMeanBaseline(rater, item);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement