Skip to content

Commit

Permalink
[doc] remove excess fit arguments from docstrings (#3330)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS authored Aug 24, 2020
1 parent 8ab3525 commit 9503d3f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions python-package/lightgbm/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,12 @@ def fit(self, X, y,
return self

_base_doc = LGBMModel.fit.__doc__
fit.__doc__ = (_base_doc[:_base_doc.find('eval_class_weight :')]
+ _base_doc[_base_doc.find('eval_init_score :'):])
_base_doc = (_base_doc[:_base_doc.find('group :')]
+ _base_doc[_base_doc.find('eval_set :'):])
_base_doc = (_base_doc[:_base_doc.find('eval_class_weight :')]
+ _base_doc[_base_doc.find('eval_init_score :'):])
fit.__doc__ = (_base_doc[:_base_doc.find('eval_group :')]
+ _base_doc[_base_doc.find('eval_metric :'):])


class LGBMClassifier(LGBMModel, _LGBMClassifierBase):
Expand Down Expand Up @@ -834,7 +838,11 @@ def fit(self, X, y,
callbacks=callbacks, init_model=init_model)
return self

fit.__doc__ = LGBMModel.fit.__doc__
_base_doc = LGBMModel.fit.__doc__
_base_doc = (_base_doc[:_base_doc.find('group :')]
+ _base_doc[_base_doc.find('eval_set :'):])
fit.__doc__ = (_base_doc[:_base_doc.find('eval_group :')]
+ _base_doc[_base_doc.find('eval_metric :'):])

def predict(self, X, raw_score=False, start_iteration=0, num_iteration=None,
pred_leaf=False, pred_contrib=False, **kwargs):
Expand Down

0 comments on commit 9503d3f

Please sign in to comment.