Commit 8d56a0b6 authored by drevicko's avatar drevicko Committed by GitHub
Browse files

fixes #31

I've used euclidean metric instead of taxicab as I feel it makes more sense (taxicab has bizzare unintuitive effects for points far from the centroids).
parent 8c704333
......@@ -52,7 +52,7 @@ class CentroidConversion(EmotionConversionPlugin):
dimensions = list(self.centroids.values())[0]
def distance(e1, e2):
return sum((e1[k] - e2.get(k, 0)) for k in dimensions)
return sum((e1[k] - e2.get(k, 0)**2) for k in dimensions)
emotion = ''
mindistance = 10000000000000000000000.0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment