def test_prediction_full(self): gmm0 = GMM(self.M, self.D, cvtype='full') likelihood0 = gmm0.train(self.X) Y0 = gmm0.predict(self.X) gmm1 = GMM(self.M, self.D, cvtype='full') likelihood1 = gmm1.train(self.X) Y1 = gmm1.predict(self.X) for a,b in zip(Y0, Y1): self.assertAlmostEqual(a,b) self.assertTrue(len(set(Y0)) > 1)
def test_prediction_full(self): print "test prediction full" gmm0 = GMM(self.M, self.D, cvtype='full') likelihood0 = gmm0.train(self.X) Y0 = gmm0.predict(self.X) gmm1 = GMM(self.M, self.D, cvtype='full') likelihood1 = gmm1.train(self.X) Y1 = gmm1.predict(self.X) for a,b in zip(Y0, Y1): self.assertAlmostEqual(a,b, places=3) self.assertTrue(len(set(Y0)) > 1)
def test_prediction_once(self): gmm0 = GMM(self.M, self.D, cvtype='diag') likelihood0 = gmm0.train(self.X) Y0 = gmm0.predict(self.X) gmm1 = GMM(self.M, self.D, cvtype='diag') likelihood1 = gmm1.train(self.X) Y1 = gmm1.predict(self.X) for a, b in zip(Y0, Y1): self.assertAlmostEqual(a, b) self.assertTrue(len(set(Y0)) > 1)
def test_prediction_full(self): print "test prediction full" gmm0 = GMM(self.M, self.D, cvtype="full") likelihood0 = gmm0.train(self.X) Y0 = gmm0.predict(self.X) gmm1 = GMM(self.M, self.D, cvtype="full") likelihood1 = gmm1.train(self.X) Y1 = gmm1.predict(self.X) for a, b in zip(Y0, Y1): self.assertAlmostEqual(a, b, places=3) self.assertTrue(len(set(Y0)) > 1)