예제 #1
0
파일: gmm_test.py 프로젝트: StevenLOL/gmm
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
파일: gmm_test.py 프로젝트: Nganou/pycasp
    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)