Fix using categorical data with the score function of ranker. (#9753)

This commit is contained in:
Jiaming Yuan
2023-11-07 07:29:11 +08:00
committed by GitHub
parent 82828621d0
commit c3a0622b49
4 changed files with 48 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ import pytest
import xgboost as xgb
from xgboost import testing as tm
from xgboost.testing.ranking import run_ranking_qid_df
from xgboost.testing.ranking import run_ranking_categorical, run_ranking_qid_df
sys.path.append("tests/python")
import test_with_sklearn as twskl # noqa
@@ -256,6 +256,11 @@ def test_ranking_qid_df():
run_ranking_qid_df(cudf, "gpu_hist")
@pytest.mark.skipif(**tm.no_pandas())
def test_ranking_categorical() -> None:
run_ranking_categorical(device="cuda")
@pytest.mark.skipif(**tm.no_cupy())
@pytest.mark.mgpu
def test_device_ordinal() -> None: