Пример #1
0
    def testEvaluateCvOuter(self):
        folds = 3
        rankBoost = RankBoost()
        (bestParams, allMetrics, bestMetaDicts) = rankBoost.evaluateCvOuter(self.X, self.y, folds)

        self.assertEquals(len(allMetrics[0]), folds)
        self.assertEquals(len(allMetrics[2]), folds)
Пример #2
0
    def testEvaluateCvOuter(self):
        folds = 3
        rankBoost = RankBoost()
        (bestParams, allMetrics,
         bestMetaDicts) = rankBoost.evaluateCvOuter(self.X, self.y, folds)

        self.assertEquals(len(allMetrics[0]), folds)
        self.assertEquals(len(allMetrics[2]), folds)
Пример #3
0
    def testPredict(self):
        rankBoost = RankBoost()
        rankBoost.learnModel(self.X, self.y)
        predY = rankBoost.predict(self.X)

        self.assertTrue(
            Evaluator.auc(predY, self.y) <= 1.0
            and Evaluator.auc(predY, self.y) >= 0.0)
Пример #4
0
    def testSetLearners(self):
        rankBoost = RankBoost()
        rankBoost.setIterations(10)
        rankBoost.setLearners(20)
        rankBoost.learnModel(self.X, self.y)

        predY = rankBoost.predict(self.X)
Пример #5
0
    def testSetLearners(self):
        rankBoost = RankBoost()
        rankBoost.setIterations(10)
        rankBoost.setLearners(20)
        rankBoost.learnModel(self.X, self.y)

        predY = rankBoost.predict(self.X)
Пример #6
0
 def testStr(self):
     rankBoost = RankBoost()
Пример #7
0
 def testLearnModel(self):
     rankBoost = RankBoost()
     rankBoost.learnModel(self.X, self.y)
Пример #8
0
 def testInit(self):
     rankBoost = RankBoost()
Пример #9
0
    def testPredict(self):
        rankBoost = RankBoost()
        rankBoost.learnModel(self.X, self.y)
        predY = rankBoost.predict(self.X)

        self.assertTrue(Evaluator.auc(predY, self.y) <= 1.0 and Evaluator.auc(predY, self.y) >= 0.0)
Пример #10
0
 def testLearnModel(self):
     rankBoost = RankBoost()
     rankBoost.learnModel(self.X, self.y)