[
https://issues.apache.org/jira/browse/MAHOUT-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17217575#comment-17217575
]
Trevor Grant commented on MAHOUT-1958:
--------------------------------------
[~haozhong] we changed our default branch and all issues were closed- if you
would still like to submit this- please reopen again the `trunk` branch, and
thanks!
> CityBlockSimilarity.itemSimilarities can overflow
> -------------------------------------------------
>
> Key: MAHOUT-1958
> URL: https://issues.apache.org/jira/browse/MAHOUT-1958
> Project: Mahout
> Issue Type: Bug
> Components: Math
> Affects Versions: 1.0.0
> Reporter: Hao Zhong
> Priority: Major
>
> The CityBlockSimilarity.itemSimilarities method has the following code:
> {code:title=CityBlockSimilarity.java|borderStyle=solid}
> int preferring2 = dataModel.getNumUsersWithPreferenceFor(itemID2s[i]);
> int intersection = dataModel.getNumUsersWithPreferenceFor(itemID1,
> itemID2s[i]);
> {code}
> Here, the two methods return long values, and can overflow. Indeed,
> LogLikelihoodSimilaritydoItemSimilarity once had the same problem. The fixed
> code is
> {code:title=LogLikelihoodSimilaritydoItemSimilarity.java|borderStyle=solid}
> long preferring1 = dataModel.getNumUsersWithPreferenceFor(itemID1);
> long numUsers = dataModel.getNumUsers();
> {code}
> Please refer to MAHOUT-738 for details.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)