Exemplo n.º 1
0
    def testGenerate(self):
        generate = LinearSvmFGs.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)
Exemplo n.º 2
0
    def testGenerate(self):
        generate = LinearSvmFGs.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)
Exemplo n.º 3
0
 def testSetWeight(self):
     learner = LinearSvmFGs()
     learner.setWeight(0.8)
Exemplo n.º 4
0
 def testSetWeight(self):
     learner = LinearSvmFGs()
     learner.setWeight(0.8)