[Scipy-svn] r3102 - trunk/Lib/sandbox/pyem/tests

scipy-svn@scip... scipy-svn@scip...
Wed Jun 13 05:29:33 CDT 2007


Author: cdavid
Date: 2007-06-13 05:29:29 -0500 (Wed, 13 Jun 2007)
New Revision: 3102

Modified:
   trunk/Lib/sandbox/pyem/tests/test_gmm_em.py
Log:
Trivial fix for typo in pyem tests.

Modified: trunk/Lib/sandbox/pyem/tests/test_gmm_em.py
===================================================================
--- trunk/Lib/sandbox/pyem/tests/test_gmm_em.py	2007-06-13 10:26:06 UTC (rev 3101)
+++ trunk/Lib/sandbox/pyem/tests/test_gmm_em.py	2007-06-13 10:29:29 UTC (rev 3102)
@@ -137,9 +137,9 @@
         gmm = GMM(gm, 'test')
         EM().train(dic['data'], gmm)
 
-        assert_array_equal(gmm.gm.w, dic['w'], DEF_DEC)
-        assert_array_equal(gmm.gm.mu, dic['mu'], DEF_DEC)
-        assert_array_equal(gmm.gm.va, dic['va'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.w, dic['w'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.mu, dic['mu'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.va, dic['va'], DEF_DEC)
 
     def test_2d_full(self, level = 1):
         d = 2
@@ -151,9 +151,9 @@
         gmm = GMM(gm, 'test')
         EM().train(dic['data'], gmm)
 
-        assert_array_equal(gmm.gm.w, dic['w'], DEF_DEC)
-        assert_array_equal(gmm.gm.mu, dic['mu'], DEF_DEC)
-        assert_array_equal(gmm.gm.va, dic['va'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.w, dic['w'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.mu, dic['mu'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.va, dic['va'], DEF_DEC)
 
     def test_2d_diag(self, level = 1):
         d = 2
@@ -165,9 +165,9 @@
         gmm = GMM(gm, 'test')
         EM().train(dic['data'], gmm)
 
-        assert_array__almost_equal(gmm.gm.w, dic['w'], DEF_DEC)
-        assert_array__almost_equal(gmm.gm.mu, dic['mu'], DEF_DEC)
-        assert_array__almost_equal(gmm.gm.va, dic['va'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.w, dic['w'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.mu, dic['mu'], DEF_DEC)
+        assert_array_almost_equal(gmm.gm.va, dic['va'], DEF_DEC)
 
 class test_log_domain(EmTest):
     """This class tests whether the GMM works in log domain."""



More information about the Scipy-svn mailing list