Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)