Change this.minSim = 0; to this.minSim = Double.NEGATIVE_INFINITY; and then you can remove the check for it being > 0 later. This is because similarity could be negative. Then you can cull the commented lines, then looks good to me.
Yeah I like just pushing it together rather than making two classes here. On Thu, Jan 15, 2009 at 9:36 PM, Otis Gospodnetic (JIRA) <[email protected]> wrote: > > [ > https://issues.apache.org/jira/browse/MAHOUT-95?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel > ] > > Otis Gospodnetic updated MAHOUT-95: > ----------------------------------- > > Attachment: MAHOUT-95.patch > > Something like this? > > The other patch was a bit more code, but was a bit more "explicit" for both a > person reading and the JVM. Will the JVM inline those if tests in the now > modified estimate(User user) method? > > >> UserSimilarity-based NearestNNeighborhood >> ----------------------------------------- >> >> Key: MAHOUT-95 >> URL: https://issues.apache.org/jira/browse/MAHOUT-95 >> Project: Mahout >> Issue Type: Improvement >> Components: Collaborative Filtering >> Reporter: Otis Gospodnetic >> Priority: Minor >> Fix For: 0.1 >> >> Attachments: MAHOUT-95-diff-against-nearestN.txt, MAHOUT-95.patch, >> MAHOUT-95.patch, MAHOUT-95.patch, MAHOUT-95.patch >> >> >> A variation of NearestNUserNeighborhood. This version adds the >> minSimilarity parameter, which is the primary factor for including/excluding >> other users from the target user's neighbourhood. Additionally, the 'n' >> parameter was renamed to maxHoodSize and is used to optionally limit the >> size of the neighbourhood. >> The patch is for a brand new class, but we may really want just a single >> class (either keep this one and axe NearestNUserNeighborhood or add this >> functionality to NearestNUserNeighborhood), if this sounds good. >> I'll update the unit test and provide a patch for that if others think this >> can go in. >> Thoughts? > > -- > This message is automatically generated by JIRA. > - > You can reply to this email to add a comment to the issue online. > >
