Update learning_to_rank.rst; Correct qid sort in snippet (#9673)

This commit is contained in:
Thomas Lynn 2023-10-14 10:38:58 +02:00 committed by GitHub
parent eee7cdf07e
commit 83191f0839
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,6 +58,7 @@ Notice that the samples are sorted based on their query index in a non-decreasin
sorted_idx = np.argsort(qid)
X = X[sorted_idx, :]
y = y[sorted_idx]
qid = qid[sorted_idx]
The simplest way to train a ranking model is by using the scikit-learn estimator interface. Continuing the previous snippet, we can train a simple ranking model without tuning: