Пример #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)
Пример #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)
Пример #3
0
    def testSetWeight(self):
        learner = DecisionTreeF()

        learner.setWeight(0.8)
Пример #4
0
    def testSetWeight(self):
        learner = DecisionTreeF()

        learner.setWeight(0.8)