Skip to content

Commit

Permalink
change the priority of init_score and init_model. (#2291)
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Jul 31, 2019
1 parent 04a5601 commit 6c21020
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions python-package/lightgbm/basic.py
Expand Up @@ -848,13 +848,12 @@ def _lazy_init(self, data, label=None, reference=None,
self.set_weight(weight)
if group is not None:
self.set_group(group)
# load init score
if init_score is not None:
self.set_init_score(init_score)
if predictor is not None:
warnings.warn("The prediction of init_model will be overridden by init_score.")
elif isinstance(predictor, _InnerPredictor):
if isinstance(predictor, _InnerPredictor):
if self._predictor is None and init_score is not None:
warnings.warn("The init_score will be overridden by the prediction of init_model.")
self._set_init_score_by_predictor(predictor, data)
elif init_score is not None:
self.set_init_score(init_score)
elif predictor is not None:
raise TypeError('Wrong predictor type {}'.format(type(predictor).__name__))
# set feature names
Expand Down

0 comments on commit 6c21020

Please sign in to comment.