Unverified Commit 560a0350 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[docs] add specific estimator names to sklearn fit() docs (#4774)

parent cebdc2a8
......@@ -262,7 +262,7 @@ _lgbmmodel_doc_fit = (
Returns
-------
self : object
self : LGBMModel
Returns self.
"""
)
......@@ -921,7 +921,7 @@ class LGBMRegressor(_LGBMRegressorBase, LGBMModel):
categorical_feature=categorical_feature, callbacks=callbacks, init_model=init_model)
return self
_base_doc = LGBMModel.fit.__doc__
_base_doc = LGBMModel.fit.__doc__.replace("self : LGBMModel", "self : LGBMRegressor")
_base_doc = (_base_doc[:_base_doc.find('group :')] # type: ignore
+ _base_doc[_base_doc.find('eval_set :'):]) # type: ignore
_base_doc = (_base_doc[:_base_doc.find('eval_class_weight :')]
......@@ -994,7 +994,7 @@ class LGBMClassifier(_LGBMClassifierBase, LGBMModel):
callbacks=callbacks, init_model=init_model)
return self
_base_doc = LGBMModel.fit.__doc__
_base_doc = LGBMModel.fit.__doc__.replace("self : LGBMModel", "self : LGBMClassifier")
_base_doc = (_base_doc[:_base_doc.find('group :')] # type: ignore
+ _base_doc[_base_doc.find('eval_set :'):]) # type: ignore
fit.__doc__ = (_base_doc[:_base_doc.find('eval_group :')]
......@@ -1093,7 +1093,7 @@ class LGBMRanker(LGBMModel):
categorical_feature=categorical_feature, callbacks=callbacks, init_model=init_model)
return self
_base_doc = LGBMModel.fit.__doc__
_base_doc = LGBMModel.fit.__doc__.replace("self : LGBMModel", "self : LGBMRanker")
fit.__doc__ = (_base_doc[:_base_doc.find('eval_class_weight :')] # type: ignore
+ _base_doc[_base_doc.find('eval_init_score :'):]) # type: ignore
_base_doc = fit.__doc__
......
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