"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "5e592fe6ff2b6eed83dd77942aab8e464768235c"
Unverified Commit 709ea4ca authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[python-package] [dask] fix mypy errors about Dask fit() return types (#5756)

parent e4231205
...@@ -1175,7 +1175,7 @@ class DaskLGBMClassifier(LGBMClassifier, _DaskLGBMModel): ...@@ -1175,7 +1175,7 @@ class DaskLGBMClassifier(LGBMClassifier, _DaskLGBMModel):
**kwargs: Any **kwargs: Any
) -> "DaskLGBMClassifier": ) -> "DaskLGBMClassifier":
"""Docstring is inherited from the lightgbm.LGBMClassifier.fit.""" """Docstring is inherited from the lightgbm.LGBMClassifier.fit."""
return self._lgb_dask_fit( self._lgb_dask_fit(
model_factory=LGBMClassifier, model_factory=LGBMClassifier,
X=X, X=X,
y=y, y=y,
...@@ -1189,6 +1189,7 @@ class DaskLGBMClassifier(LGBMClassifier, _DaskLGBMModel): ...@@ -1189,6 +1189,7 @@ class DaskLGBMClassifier(LGBMClassifier, _DaskLGBMModel):
eval_metric=eval_metric, eval_metric=eval_metric,
**kwargs **kwargs
) )
return self
_base_doc = _lgbmmodel_doc_fit.format( _base_doc = _lgbmmodel_doc_fit.format(
X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]", X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]",
...@@ -1378,7 +1379,7 @@ class DaskLGBMRegressor(LGBMRegressor, _DaskLGBMModel): ...@@ -1378,7 +1379,7 @@ class DaskLGBMRegressor(LGBMRegressor, _DaskLGBMModel):
**kwargs: Any **kwargs: Any
) -> "DaskLGBMRegressor": ) -> "DaskLGBMRegressor":
"""Docstring is inherited from the lightgbm.LGBMRegressor.fit.""" """Docstring is inherited from the lightgbm.LGBMRegressor.fit."""
return self._lgb_dask_fit( self._lgb_dask_fit(
model_factory=LGBMRegressor, model_factory=LGBMRegressor,
X=X, X=X,
y=y, y=y,
...@@ -1391,6 +1392,7 @@ class DaskLGBMRegressor(LGBMRegressor, _DaskLGBMModel): ...@@ -1391,6 +1392,7 @@ class DaskLGBMRegressor(LGBMRegressor, _DaskLGBMModel):
eval_metric=eval_metric, eval_metric=eval_metric,
**kwargs **kwargs
) )
return self
_base_doc = _lgbmmodel_doc_fit.format( _base_doc = _lgbmmodel_doc_fit.format(
X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]", X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]",
...@@ -1550,7 +1552,7 @@ class DaskLGBMRanker(LGBMRanker, _DaskLGBMModel): ...@@ -1550,7 +1552,7 @@ class DaskLGBMRanker(LGBMRanker, _DaskLGBMModel):
**kwargs: Any **kwargs: Any
) -> "DaskLGBMRanker": ) -> "DaskLGBMRanker":
"""Docstring is inherited from the lightgbm.LGBMRanker.fit.""" """Docstring is inherited from the lightgbm.LGBMRanker.fit."""
return self._lgb_dask_fit( self._lgb_dask_fit(
model_factory=LGBMRanker, model_factory=LGBMRanker,
X=X, X=X,
y=y, y=y,
...@@ -1566,6 +1568,7 @@ class DaskLGBMRanker(LGBMRanker, _DaskLGBMModel): ...@@ -1566,6 +1568,7 @@ class DaskLGBMRanker(LGBMRanker, _DaskLGBMModel):
eval_at=eval_at, eval_at=eval_at,
**kwargs **kwargs
) )
return self
_base_doc = _lgbmmodel_doc_fit.format( _base_doc = _lgbmmodel_doc_fit.format(
X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]", X_shape="Dask Array or Dask DataFrame of shape = [n_samples, n_features]",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment