Skip to content

Commit

Permalink
fix refit decay rate in python (#2254)
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Jul 7, 2019
1 parent bf78008 commit 1bd15b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python-package/lightgbm/basic.py
Expand Up @@ -2362,7 +2362,9 @@ def refit(self, data, label, decay_rate=0.9, **kwargs):
leaf_preds = predictor.predict(data, -1, pred_leaf=True)
nrow, ncol = leaf_preds.shape
train_set = Dataset(data, label, silent=True)
new_booster = Booster(self.params, train_set, silent=True)
new_params = copy.deepcopy(self.params)
new_params['refit_decay_rate'] = decay_rate
new_booster = Booster(new_params, train_set, silent=True)
# Copy models
_safe_call(_LIB.LGBM_BoosterMerge(
new_booster.handle,
Expand Down

0 comments on commit 1bd15b9

Please sign in to comment.