Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in reset config for dataset #2453

Merged
merged 2 commits into from Sep 26, 2019
Merged

fix bug in reset config for dataset #2453

merged 2 commits into from Sep 26, 2019

Conversation

guolinke
Copy link
Collaborator

to fix #2452

@aprilffff
Copy link

to fix #2452

should add const Dataset* train_data in function declaration?

@guolinke guolinke merged commit 7a8c4e5 into master Sep 26, 2019
@StrikerRUS StrikerRUS deleted the guolinke-patch-1 branch September 26, 2019 19:49
@aprilffff
Copy link

still not work

@guolinke
Copy link
Collaborator Author

@aprilffff
before nv.model.reset_parameter({'feature_contri':new_fb.tolist()}), you should try to reset parameter to train-set as well.

def _update_params(self, params):
if self.handle is not None and params is not None:
_safe_call(_LIB.LGBM_DatasetUpdateParam(self.handle, c_str(param_dict_to_str(params))))
if not self.params:
self.params = copy.deepcopy(params)
else:
self.params_back_up = copy.deepcopy(self.params)
self.params.update(params)
return self

@aprilffff
Copy link

aprilffff commented Nov 26, 2019

I tried this code in the callback function but still not work
params={'feature_contrib':fblist}
env.params.update(params)
env.model.train_set._update_params(params)
env.model.reset_parameter(params)

@aprilffff
Copy link

Dont worry, your advice is right. It's completely fixed now. Thx.

@StrikerRUS StrikerRUS added the fix label Mar 1, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reset feature_contrib not working
3 participants