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