[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 <chohyu01@cs.washington.edu>
This commit is contained in:
parent
61ac8eec8a
commit
124bc57a6e
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user