예제 #1
0
    def testGenerate(self):
        generate = SVC.generate()

        svc = generate()

        svc.learnModel(self.X, self.y)
        predY = svc.predict(self.X)
예제 #2
0
    def testGenerate(self):
        generate = SVC.generate()

        svc = generate()

        svc.learnModel(self.X, self.y)
        predY = svc.predict(self.X)
예제 #3
0
    def testSetWeight(self):
        #Try weight = 0 and weight = 1
        svc = SVC()
        svc.setWeight(0.0)
        svc.learnModel(self.X, self.y)

        predY = svc.predict(self.X)
        self.assertTrue((predY == numpy.zeros(predY.shape[0])).all())

        svc.setWeight(1.0)
        svc.learnModel(self.X, self.y)
        predY = svc.predict(self.X)
        self.assertTrue((predY == numpy.ones(predY.shape[0])).all())
예제 #4
0
    def testSetWeight(self):
        #Try weight = 0 and weight = 1
        svc = SVC()
        svc.setWeight(0.0)
        svc.learnModel(self.X, self.y)

        predY = svc.predict(self.X)
        self.assertTrue((predY == numpy.zeros(predY.shape[0])).all())

        svc.setWeight(1.0)
        svc.learnModel(self.X, self.y)
        predY = svc.predict(self.X)
        self.assertTrue((predY == numpy.ones(predY.shape[0])).all())