mirror of
https://github.com/gsi-upm/senpy
synced 2024-11-22 00:02:28 +00:00
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).
This commit is contained in:
parent
8c70433312
commit
8d56a0b630
@ -52,7 +52,7 @@ class CentroidConversion(EmotionConversionPlugin):
|
|||||||
dimensions = list(self.centroids.values())[0]
|
dimensions = list(self.centroids.values())[0]
|
||||||
|
|
||||||
def distance(e1, e2):
|
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 = ''
|
emotion = ''
|
||||||
mindistance = 10000000000000000000000.0
|
mindistance = 10000000000000000000000.0
|
||||||
|
Loading…
Reference in New Issue
Block a user