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)
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)
def testSetLearners(self): rankBoost = RankBoost() rankBoost.setIterations(10) rankBoost.setLearners(20) rankBoost.learnModel(self.X, self.y) predY = rankBoost.predict(self.X)
def testStr(self): rankBoost = RankBoost()
def testLearnModel(self): rankBoost = RankBoost() rankBoost.learnModel(self.X, self.y)
def testInit(self): rankBoost = RankBoost()
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)