Skip to content

[c++] Add Bagging by Query for Lambdarank #6623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix bagging by query test case
  • Loading branch information
shiyu1994 committed Aug 30, 2024
commit 666c51ef65f84e9d7387a7a604ac280ad7e49bb9
6 changes: 3 additions & 3 deletions tests/python_package_test/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4420,6 +4420,6 @@ def test_bagging_by_query_in_lambdarank():
params.update({"bagging_by_query": False, "bagging_fraction": 0.1, "bagging_freq": 1})
gbm_no_bagging_by_query = lgb.train(params, lgb_train, num_boost_round=50, valid_sets=[lgb_test])
ndcg_score_no_bagging_by_query = gbm_no_bagging_by_query.best_score["valid_0"]["ndcg@5"]

assert ndcg_score_bagging_by_query >= ndcg_score
assert ndcg_score_no_bagging_by_query <= ndcg_score
print(ndcg_score_bagging_by_query, ndcg_score, ndcg_score_no_bagging_by_query)
assert ndcg_score_bagging_by_query >= ndcg_score - 0.03
assert ndcg_score_no_bagging_by_query <= ndcg_score_bagging_by_query
Loading