From 96fa1f5646c58884359a2b6e44c0672c25209b9f Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 25 Oct 2021 22:48:50 -0500 Subject: [PATCH 1/2] [docs] [dask] Add return information to Dask fit() docs (fixes #4402) --- python-package/lightgbm/dask.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/python-package/lightgbm/dask.py b/python-package/lightgbm/dask.py index 299733ba11fc..1c9cca24a825 100644 --- a/python-package/lightgbm/dask.py +++ b/python-package/lightgbm/dask.py @@ -1214,6 +1214,11 @@ def fit( Other parameters passed through to ``LGBMClassifier.fit()``. {_lgbmmodel_doc_custom_eval_note} + + Returns + ------- + self : lightgbm.DaskLGBMClassifier + Returns self. """ def predict(self, X: _DaskMatrixLike, **kwargs: Any) -> dask_Array: @@ -1394,6 +1399,11 @@ def fit( Other parameters passed through to ``LGBMRegressor.fit()``. {_lgbmmodel_doc_custom_eval_note} + + Returns + ------- + self : lightgbm.DaskLGBMRegressor + Returns self. """ def predict(self, X: _DaskMatrixLike, **kwargs) -> dask_Array: @@ -1557,6 +1567,11 @@ def fit( Other parameters passed through to ``LGBMRanker.fit()``. {_lgbmmodel_doc_custom_eval_note} + + Returns + ------- + self : lightgbm.DaskLGBMRanker + Returns self. """ def predict(self, X: _DaskMatrixLike, **kwargs: Any) -> dask_Array: From d78839fee7632fe17dc86a0b349a2bc085f4e0c0 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 6 Nov 2021 20:12:49 -0500 Subject: [PATCH 2/2] put return before note --- python-package/lightgbm/dask.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python-package/lightgbm/dask.py b/python-package/lightgbm/dask.py index 1c9cca24a825..b985c08757c7 100644 --- a/python-package/lightgbm/dask.py +++ b/python-package/lightgbm/dask.py @@ -1213,12 +1213,12 @@ def fit( fit.__doc__ = f"""{_base_doc[:_base_doc.find('callbacks :')]}**kwargs Other parameters passed through to ``LGBMClassifier.fit()``. - {_lgbmmodel_doc_custom_eval_note} - Returns ------- self : lightgbm.DaskLGBMClassifier Returns self. + + {_lgbmmodel_doc_custom_eval_note} """ def predict(self, X: _DaskMatrixLike, **kwargs: Any) -> dask_Array: @@ -1398,12 +1398,12 @@ def fit( fit.__doc__ = f"""{_base_doc[:_base_doc.find('callbacks :')]}**kwargs Other parameters passed through to ``LGBMRegressor.fit()``. - {_lgbmmodel_doc_custom_eval_note} - Returns ------- self : lightgbm.DaskLGBMRegressor Returns self. + + {_lgbmmodel_doc_custom_eval_note} """ def predict(self, X: _DaskMatrixLike, **kwargs) -> dask_Array: @@ -1566,12 +1566,12 @@ def fit( fit.__doc__ = f"""{_base_doc[:_base_doc.find('callbacks :')]}**kwargs Other parameters passed through to ``LGBMRanker.fit()``. - {_lgbmmodel_doc_custom_eval_note} - Returns ------- self : lightgbm.DaskLGBMRanker Returns self. + + {_lgbmmodel_doc_custom_eval_note} """ def predict(self, X: _DaskMatrixLike, **kwargs: Any) -> dask_Array: