]> gitweb.factorcode.org Git - factor.git/commitdiff
math.similarity: fix tests, not sure this is the correct definition.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 8 May 2012 15:05:31 +0000 (08:05 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 8 May 2012 15:05:31 +0000 (08:05 -0700)
extra/math/similarity/similarity.factor

index a8ae722282f70c8b68166a274bc91dec012a759a..b1f78569c0a5f484e0eb60c025b8894d932c6b43 100644 (file)
@@ -9,7 +9,7 @@ IN: math.similarity
     v- norm 1 + recip ;
 
 : pearson-similarity ( a b -- n )
-    over length 3 < [ 2drop 1.0 ] [ corr 0.5 * 0.5 + ] if ;
+    over length 3 < [ 2drop 1.0 ] [ full-corr 0.5 * 0.5 + ] if ;
 
 : cosine-similarity ( a b -- n )
     [ v* sum ] [ [ norm ] bi@ * ] 2bi / 0.5 * 0.5 + ;