@@ -1785,7 +1785,7 @@ def fit(
1785
1785
end_note = """
1786
1786
.. note::
1787
1787
1788
- The default objectivefor XGBRanker is "rank:pairwise"
1788
+ The default objective for XGBRanker is "rank:pairwise"
1789
1789
1790
1790
.. note::
1791
1791
@@ -1795,11 +1795,16 @@ def fit(
1795
1795
.. note::
1796
1796
1797
1797
Query group information is required for ranking tasks by either using the
1798
- `group` parameter or `qid` parameter in `fit` method.
1798
+ `group` parameter or `qid` parameter in `fit` method. This information is
1799
+ not required in 'predict' method and multiple groups can be predicted on
1800
+ a single call to `predict`.
1799
1801
1800
- Before fitting the model, your data need to be sorted by query group. When fitting
1801
- the model, you need to provide an additional array that contains the size of each
1802
+ When fitting the model with the `group` parameter , your data need to be sorted
1803
+ by query group first. `group` must be an array that contains the size of each
1802
1804
query group.
1805
+ When fitting the model with the `qid` parameter, your data does not need
1806
+ sorting. `qid` must be an array that contains the group of each training
1807
+ sample.
1803
1808
1804
1809
For example, if your original data look like:
1805
1810
@@ -1821,8 +1826,8 @@ def fit(
1821
1826
| 2 | 1 | x_7 |
1822
1827
+-------+-----------+---------------+
1823
1828
1824
- then your group array should be ``[3, 4]``. Sometimes using query id (`qid`)
1825
- instead of group can be more convenient .
1829
+ then `fit` method can be called with either ` group` array as ``[3, 4]``
1830
+ or with `qid` as ``[`1, 1, 1, 2, 2, 2, 2]``, that is the qid column .
1826
1831
""" ,
1827
1832
)
1828
1833
class XGBRanker (XGBModel , XGBRankerMixIn ):
0 commit comments