diff --git a/doc/tutorials/learning_to_rank.rst b/doc/tutorials/learning_to_rank.rst index c562dc2df..015f736e0 100644 --- a/doc/tutorials/learning_to_rank.rst +++ b/doc/tutorials/learning_to_rank.rst @@ -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: