]> gitweb.factorcode.org Git - factor.git/commit
math.similarity: change cosine-similarity to match math formula.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 24 Oct 2017 18:45:03 +0000 (11:45 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 24 Oct 2017 18:45:03 +0000 (11:45 -0700)
commitee1bfc7fc2c13d13470221271cd9fdc9c937c811
treef09ac1c26419d215d02c0c6eaf50231dfdc2023f
parentc3354c31675dfcca0bd681035a06580254442769
math.similarity: change cosine-similarity to match math formula.

Specifically, instead of returning values [0,1], we now return [-1,1]:

* −1 meaning exactly opposite
* 1 meaning exactly the same
* 0 indicating orthogonality (decorrelation)
* in-between values indicating intermediate similarity or dissimilarity.
extra/math/similarity/similarity-tests.factor
extra/math/similarity/similarity.factor