Ejemplo n.º 1
0
    def testGenerate(self):
        generate = DecisionTreeF.generate()

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

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

        predY = decisionTree.predict(self.X)

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

        predY = decisionTree.predict(self.X)
Ejemplo n.º 2
0
    def testGenerate(self):
        generate = DecisionTreeF.generate()

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

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

        predY = decisionTree.predict(self.X)

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

        predY = decisionTree.predict(self.X)
Ejemplo n.º 3
0
    def testSetWeight(self):
        learner = DecisionTreeF()

        learner.setWeight(0.8)
Ejemplo n.º 4
0
    def testSetWeight(self):
        learner = DecisionTreeF()

        learner.setWeight(0.8)