You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Prof. He!
In the ItemKNN.java, the similarity matrix is a diagonal matrix but the method buildModel_items only seems to calculate the values in the lower triangular part and doesn't assign the values to the symmetry elements.
The experimental results show that there are some differences between using itemCount && j != i and itemCount in line 5 (line 71 of the original code).
protectedvoidbuildModel_items(intstartItem, intendItem) {
// Build the similarity matrix for selected items.for (inti = startItem; i < endItem; i++) {
HashMap<Integer, Double> map_item_score = newHashMap<Integer, Double>();
for (intj = 0; j < itemCount && j != i; j++) {
// Cosine similaritydoublescore = trainMatrix.getColRef(i).innerProduct(trainMatrix.getColRef(j));
if (score != 0) {
score /= (lengths[i] * lengths[j]);
map_item_score.put(j, score);
}
}
if (K <= 0) { // All neighborsfor (intj : map_item_score.keySet()) {
similarity.setValue(i, j, map_item_score.get(j));
}
} else { // Only K nearest neighborsfor (intj : CommonUtils.TopKeysByValue(map_item_score, K, null)) {
similarity.setValue(i, j, map_item_score.get(j));
}
} // end if
} // end for
Hi, Prof. He!
In the ItemKNN.java, the similarity matrix is a diagonal matrix but the method buildModel_items only seems to calculate the values in the lower triangular part and doesn't assign the values to the symmetry elements.
The experimental results show that there are some differences between using itemCount && j != i and itemCount in line 5 (line 71 of the original code).
sigir16-eals/src/algorithms/ItemKNN.java
Line 71 in 993d19f
The text was updated successfully, but these errors were encountered: