def test_mcrank_set_estimator_params(): gb = GradientBoostingClassifier(n_estimators=5, loss="deviance", random_state=0) mc = McRank(gb) mc.set_params(estimator__n_estimators=10) assert_equal(gb.n_estimators, 10)
def test_mcrank(): gb = GradientBoostingClassifier(n_estimators=10, loss="deviance", random_state=0) mc = McRank(gb) mc.fit(X, y) assert_almost_equal(mc.score(X, y), 48.08, 2)
def test_mcrank_warm_start(): gb = GradientBoostingClassifier(n_estimators=5, loss="deviance", warm_start=True, random_state=0) mc = McRank(gb) mc.fit(X, y) assert_almost_equal(mc.score(X, y), 56.06, 1) mc.set_params(estimator__n_estimators=10) mc.fit(X, y) assert_almost_equal(mc.score(X, y), 48.08, 2)