Unverified Commit 6c210209 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

change the priority of init_score and init_model. (#2291)

parent 04a56010
...@@ -848,13 +848,12 @@ class Dataset(object): ...@@ -848,13 +848,12 @@ class Dataset(object):
self.set_weight(weight) self.set_weight(weight)
if group is not None: if group is not None:
self.set_group(group) self.set_group(group)
# load init score if isinstance(predictor, _InnerPredictor):
if init_score is not None: if self._predictor is None and init_score is not None:
self.set_init_score(init_score) warnings.warn("The init_score will be overridden by the prediction of init_model.")
if predictor is not None:
warnings.warn("The prediction of init_model will be overridden by init_score.")
elif isinstance(predictor, _InnerPredictor):
self._set_init_score_by_predictor(predictor, data) 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: elif predictor is not None:
raise TypeError('Wrong predictor type {}'.format(type(predictor).__name__)) raise TypeError('Wrong predictor type {}'.format(type(predictor).__name__))
# set feature names # set feature names
......
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