[ 
https://issues.apache.org/jira/browse/MAHOUT-406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873659#action_12873659
 ] 

Sean Owen commented on MAHOUT-406:
----------------------------------

Yeah I looked into this and I think all other implementations ultimately manage 
to throw an exception. This one is a special case since it actually has no 
knowledge of the underlying data.

I update the docs to be more correct: an exception is thrown if the user or 
item is known to not exist, and returns NaN if the similarity is otherwise 
unknown. These are both valid outcomes and yes you should be prepared to deal 
with either.

The only twist is that just because the method doesn't throw an exception 
doesn't mean the item/user definitely exists. 

> Inconsistent return values of different ItemSimilarity implementations
> ----------------------------------------------------------------------
>
>                 Key: MAHOUT-406
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-406
>             Project: Mahout
>          Issue Type: Bug
>          Components: Collaborative Filtering
>            Reporter: Sebastian Schelter
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.4
>
>
> org.apache.mahout.cf.taste.impl.similarity.GenericItemSimilarity returns 
> Double.NaN if you request the similarity for two itemIDs it doesn't know, 
> while  
> org.apache.mahout.cf.taste.impl.similarity.jdbc.AbstractJDBCItemSimilarity 
> throws a NoSuchItemException.
> They should act consistently (and both return Double.NaN, I guess).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to