1

Modifying logic for similarity computation

This commit is contained in:
Alex Yatskov 2015-08-10 17:00:40 +09:00
parent b1824bac53
commit 6f57277ed3

View File

@ -73,8 +73,9 @@ func similarity(features1 featureMap, features2 featureMap) float64 {
var result float64 var result float64
for key, value1 := range features1 { for key, value1 := range features1 {
value2, _ := features2[key] if value2, ok := features2[key]; ok {
result += 1 - math.Abs(value1-value2) result += value1 * value2
}
} }
return result return result