[ https://issues.apache.org/jira/browse/MAHOUT-109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard Tomsett updated MAHOUT-109: ----------------------------------- Attachment: CosineDistanceMeasurePatch.patch > Implementation of Cosine distance measure, plus unit test. > ---------------------------------------------------------- > > Key: MAHOUT-109 > URL: https://issues.apache.org/jira/browse/MAHOUT-109 > Project: Mahout > Issue Type: Improvement > Reporter: Richard Tomsett > Priority: Trivial > Attachments: CosineDistanceMeasurePatch.patch > > > This is a class implementing a cosine distance measure. In various places > I've seen cosine *similarity* defined as being the cosine of the angle > between vectors - cos(a,b) - and cosine *distance* being (1 - cos(a,b)), so > in keeping with the other distance measures, this returns 1-cos(angle) as the > distance. > Made a new test class rather than using the default distance measure check as > the vectors in the current default test class all have a cosine distance of > zero between them ([1,1,1,1,1,1], [3,3,3,3,3,3] and [6,6,6,6,6,6]). The test > checks the cosine distances between [1,0,0,0,0,0], [1,1,1,0,0,0] and > [1,1,1,1,1,1]. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.