Example #1
0
 def check_vq_1d(self, level=1):
     """Test special rank 1 vq algo, python implementation."""
     data = X[:, 0]
     initc = data[:3]
     code = initc.copy()
     if TESTC:
         a, b = _vq.vq(data, initc)
         ta, tb = py_vq(data[:, N.newaxis], initc[:, N.newaxis])
         assert_array_equal(a, ta)
         assert_array_equal(b, tb)
     else:
         print "== not testing C imp of vq (rank 1) =="
Example #2
0
 def check_py_vq(self, level=1):
     initc = N.concatenate(([[X[0]], [X[1]], [X[2]]]))
     code = initc.copy()
     label1 = py_vq(X, initc)[0]
     assert_array_equal(label1, LABEL1)