def check_vq(self, level=1): initc = N.concatenate(([[X[0]], [X[1]], [X[2]]])) code = initc.copy() if TESTC: label1, dist = _vq.vq(X, initc) assert_array_equal(label1, LABEL1) tlabel1, tdist = vq(X, initc) else: print "== not testing C imp of vq =="
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) =="