mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Schelter <...@apache.org>
Subject Re: Can anybody explain the distance method in SquaredEuclideanDistanceMeasure?
Date Fri, 04 Nov 2011 15:01:02 GMT
c = centroid
v = vector

(c - v)^2 = c^2 - 2cv + v^2

On 04.11.2011 15:58, WangRamon wrote:
> 
> 
> 
> 
> Hi All  I'm reading the code of SquaredEuclideanDistanceMeasure, the "distance(double
centroidLengthSquare, Vector centroid, Vector v)" method confused me a lot, i don't know why
we choose this expression "centroidLengthSquare - 2 * v.dot(centroid) + v.getLengthSquared()"
to calculate the distance? What is the best case to use this Measure? BTW,  I think it would
be great if we can have a wiki or some detail user guide or more comments in the source code
to explain each distance measure implementation, that will really help, thanks guys.   Cheers
 Ramon 		 	   		 

Mime
View raw message