From 124bc57a6eb8b17e8d26953d37c0fb014127d231 Mon Sep 17 00:00:00 2001 From: jpizagno Date: Sat, 22 Jun 2024 00:52:34 +0200 Subject: [PATCH] [ISSUE-10463] Add missing import in learning-to-rank tutorial (#10464) * added 'sorted()' to qid, and added pandas import * Update learning_to_rank.rst --------- Co-authored-by: Philip Hyunsu Cho --- doc/tutorials/learning_to_rank.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/tutorials/learning_to_rank.rst b/doc/tutorials/learning_to_rank.rst index 0e1f5d1a0..74e52e156 100644 --- a/doc/tutorials/learning_to_rank.rst +++ b/doc/tutorials/learning_to_rank.rst @@ -71,6 +71,7 @@ Please note that, as of writing, there's no learning-to-rank interface in scikit .. code-block:: python + import pandas as pd df = pd.DataFrame(X, columns=[str(i) for i in range(X.shape[1])]) df["qid"] = qid[sorted_idx] ranker.fit(df, y) # No need to pass qid as a separate argument