[doc] Update learning_to_rank.rst (#9336)

This commit is contained in:
jasjung
2023-06-26 22:56:18 -07:00
committed by GitHub
parent cfa9c42eb4
commit 96c3071a8a

View File

@@ -48,8 +48,9 @@ Notice that the samples are sorted based on their query index in a non-decreasin
import xgboost as xgb import xgboost as xgb
# Make a synthetic ranking dataset for demonstration # Make a synthetic ranking dataset for demonstration
X, y = make_classification(random_state=rng) seed = 1994
rng = np.random.default_rng(1994) X, y = make_classification(random_state=seed)
rng = np.random.default_rng(seed)
n_query_groups = 3 n_query_groups = 3
qid = rng.integers(0, 3, size=X.shape[0]) qid = rng.integers(0, 3, size=X.shape[0])