From 15916a950476e2971aee9d9a0bd30ed0f43b9b56 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Wed, 10 Feb 2021 03:15:29 +0300 Subject: [PATCH] [docs][python] fix shape description of returned result for predict_proba (#3933) * Update dask.py * Update sklearn.py --- python-package/lightgbm/dask.py | 8 ++++---- python-package/lightgbm/sklearn.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python-package/lightgbm/dask.py b/python-package/lightgbm/dask.py index b381789e37d3..44aa2703bbf5 100644 --- a/python-package/lightgbm/dask.py +++ b/python-package/lightgbm/dask.py @@ -630,7 +630,7 @@ def fit( fit.__doc__ = ( _base_doc[:_base_doc.find('callbacks :')] + '**kwargs\n' - + ' ' * 12 + 'Other parameters passed through to ``LGBMClassifier.fit()``\n' + + ' ' * 12 + 'Other parameters passed through to ``LGBMClassifier.fit()``.\n' ) def predict(self, X: _DaskMatrixLike, **kwargs: Any) -> dask_Array: @@ -664,7 +664,7 @@ def predict_proba(self, X: _DaskMatrixLike, **kwargs: Any) -> dask_Array: description="Return the predicted probability for each class for each sample.", X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]", output_name="predicted_probability", - predicted_result_shape="Dask Array of shape = [n_samples, n_classes]", + predicted_result_shape="Dask Array of shape = [n_samples] or shape = [n_samples, n_classes]", X_leaves_shape="Dask Array of shape = [n_samples, n_trees] or shape = [n_samples, n_trees * n_classes]", X_SHAP_values_shape="Dask Array of shape = [n_samples, n_features + 1] or shape = [n_samples, (n_features + 1) * n_classes]" ) @@ -781,7 +781,7 @@ def fit( fit.__doc__ = ( _base_doc[:_base_doc.find('callbacks :')] + '**kwargs\n' - + ' ' * 12 + 'Other parameters passed through to ``LGBMRegressor.fit()``\n' + + ' ' * 12 + 'Other parameters passed through to ``LGBMRegressor.fit()``.\n' ) def predict(self, X: _DaskMatrixLike, **kwargs) -> dask_Array: @@ -922,7 +922,7 @@ def fit( fit.__doc__ = ( _base_doc[:_base_doc.find('callbacks :')] + '**kwargs\n' - + ' ' * 12 + 'Other parameters passed through to ``LGBMRanker.fit()``\n' + + ' ' * 12 + 'Other parameters passed through to ``LGBMRanker.fit()``.\n' ) def predict(self, X: _DaskMatrixLike, **kwargs: Any) -> dask_Array: diff --git a/python-package/lightgbm/sklearn.py b/python-package/lightgbm/sklearn.py index ce5abe24f8d4..3b5fc01648e6 100644 --- a/python-package/lightgbm/sklearn.py +++ b/python-package/lightgbm/sklearn.py @@ -933,7 +933,7 @@ def predict_proba(self, X, raw_score=False, start_iteration=0, num_iteration=Non description="Return the predicted probability for each class for each sample.", X_shape="array-like or sparse matrix of shape = [n_samples, n_features]", output_name="predicted_probability", - predicted_result_shape="array-like of shape = [n_samples, n_classes]", + predicted_result_shape="array-like of shape = [n_samples] or shape = [n_samples, n_classes]", X_leaves_shape="array-like of shape = [n_samples, n_trees] or shape = [n_samples, n_trees * n_classes]", X_SHAP_values_shape="array-like of shape = [n_samples, n_features + 1] or shape = [n_samples, (n_features + 1) * n_classes] or list with n_classes length of such objects" )