def testGenerate(self): generate = SVC.generate() svc = generate() svc.learnModel(self.X, self.y) predY = svc.predict(self.X)
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())