(ltr: xgboost.XGBRanker)
| 73 | X, y, q, w = tm.make_ltr(n_samples=1024, n_features=4, n_query_groups=3, max_rel=44) |
| 74 | |
| 75 | def fit(ltr: xgboost.XGBRanker): |
| 76 | ltr.fit( |
| 77 | X, |
| 78 | y, |
| 79 | qid=q, |
| 80 | sample_weight=w, |
| 81 | eval_set=[(X, y)], |
| 82 | eval_qid=(q,), |
| 83 | sample_weight_eval_set=(w,), |
| 84 | ) |
| 85 | |
| 86 | ltr = xgboost.XGBRanker(tree_method="hist", ndcg_exp_gain=True, n_estimators=2) |
| 87 | with pytest.raises(ValueError, match="Set `ndcg_exp_gain`"): |
no test coverage detected