コード例 #1
0
    def testGenerate(self):
        generate = SvcFGs.generate()

        self.X[:, 15:25] = self.X[:, 15:25]*100

        svc = generate()
        svc.setWaveletInds(numpy.arange(100))
        svc.learnModel(self.X, self.y)
        self.assertEquals(numpy.intersect1d(numpy.arange(15,25), svc.getFeatureInds()).shape[0], 10)

        predY = svc.predict(self.X)

        #Now test when all features are wavelets
        svc = generate()
        svc.learnModel(self.X, self.y)
        self.assertEquals(numpy.intersect1d(numpy.arange(15,25), svc.getFeatureInds()).shape[0], 10)

        predY = svc.predict(self.X)
コード例 #2
0
    def testSetWeight(self):
        learner = SvcFGs()

        learner.setWeight(0.8)