Details
-
Bug
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
1.0.0
-
None
Description
The CityBlockSimilarity.itemSimilarities method has the following code:
CityBlockSimilarity.java
int preferring2 = dataModel.getNumUsersWithPreferenceFor(itemID2s[i]); int intersection = dataModel.getNumUsersWithPreferenceFor(itemID1, itemID2s[i]);
Here, the two methods return long values, and can overflow. Indeed, LogLikelihoodSimilaritydoItemSimilarity once had the same problem. The fixed code is
LogLikelihoodSimilaritydoItemSimilarity.java
long preferring1 = dataModel.getNumUsersWithPreferenceFor(itemID1); long numUsers = dataModel.getNumUsers();
Please refer to MAHOUT-738 for details.