From 41a1a242f09ed6a9c5aa9ffb68346bf4774f2580 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Fri, 21 May 2021 15:15:53 +0300 Subject: [PATCH] [docs][python] fix LGBMRanker docstring (#4306) --- python-package/lightgbm/sklearn.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python-package/lightgbm/sklearn.py b/python-package/lightgbm/sklearn.py index e0444897901d..cb7dd95a92f0 100644 --- a/python-package/lightgbm/sklearn.py +++ b/python-package/lightgbm/sklearn.py @@ -1009,7 +1009,6 @@ def fit(self, X, y, + _base_doc[_base_doc.find('eval_init_score :'):]) # type: ignore _base_doc = fit.__doc__ _before_early_stop, _early_stop, _after_early_stop = _base_doc.partition('early_stopping_rounds :') - fit.__doc__ = (f"{_before_early_stop}" - "eval_at : iterable of int, optional (default=(1, 2, 3, 4, 5))\n" - f"{' ':12}The evaluation positions of the specified metric.\n" - f"{' ':8}{_early_stop}{_after_early_stop}") + fit.__doc__ = f"""{_before_early_stop}eval_at : iterable of int, optional (default=(1, 2, 3, 4, 5)) + The evaluation positions of the specified metric. + {_early_stop}{_after_early_stop}"""