couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [16/30] bear commit: updated refs/heads/import-master to 5f99806
Date Thu, 31 Jul 2014 21:10:07 GMT
Add a new test on Pearson correlation


Project: http://git-wip-us.apache.org/repos/asf/couchdb-bear/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-bear/commit/69a9cf00
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-bear/tree/69a9cf00
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-bear/diff/69a9cf00

Branch: refs/heads/import-master
Commit: 69a9cf0097b802caae34db16681773482a8d61d8
Parents: bd20bd5
Author: Rodolphe QuiƩdeville <rodolphe@quiedeville.org>
Authored: Fri Nov 1 12:23:26 2013 +0100
Committer: Rodolphe QuiƩdeville <rodolphe@quiedeville.org>
Committed: Fri Nov 1 12:23:26 2013 +0100

----------------------------------------------------------------------
 test/bear_test.erl | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-bear/blob/69a9cf00/test/bear_test.erl
----------------------------------------------------------------------
diff --git a/test/bear_test.erl b/test/bear_test.erl
index 10d447c..2cca076 100644
--- a/test/bear_test.erl
+++ b/test/bear_test.erl
@@ -173,6 +173,11 @@ get_pearson_correlation_test() ->
     ?assertEqual(1.0, bear:get_pearson_correlation(lists:seq(0,10), lists:seq(5,15))),
     ?assertEqual(1.0, bear:get_pearson_correlation(lists:seq(40,60,2), lists:seq(10,20))).
 
+get_pearson_correlation_nullresult_test() ->
+    %% The two series do not correlate
+    A = [-1,-0.5,0,0.5,1],
+    B = [1,0.25,0,0.25,1],
+    ?assertEqual(0.0, bear:get_pearson_correlation(A, B)).
 
 round_bin_test() ->
     ?assertEqual(10, bear:round_bin(10)),


Mime
View raw message