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

[python] copy old Booster's attributes to new one in refit method #1699

Merged
merged 5 commits into from
Oct 2, 2018

Conversation

StrikerRUS
Copy link
Collaborator

@StrikerRUS StrikerRUS commented Sep 25, 2018

Fixed #1657.

I'm confused about the need to copy
https://github.com/Microsoft/LightGBM/blob/a760eae4ff06fa8d522ed53e7df8c31d9e8298f0/python-package/lightgbm/basic.py#L1438

Also, I'm not sure whether __attr should be copied.

But I suppose that it's logically correct to reset the info connected to the previous data (e.g. __train_data_name, best_iteration, valid_sets, etc.) after calling the refit method.

@StrikerRUS StrikerRUS changed the title copy old Booster's attributes to new one in refit method [python] copy old Booster's attributes to new one in refit method Sep 25, 2018
@StrikerRUS
Copy link
Collaborator Author

@guolinke What is your opinion on __attr and should __set_objective_to_none be copied?

@guolinke
Copy link
Collaborator

I think the __attr can be copied. For the __set_objective_to_none, as refit cannot support the custom objective, maybe we should check it?

@StrikerRUS
Copy link
Collaborator Author

Sorry, I'm not sure that I fully understood the part about __set_objective_to_none.

@guolinke
Copy link
Collaborator

@StrikerRUS it this ready to merge ?
BTW, it seems appveyor is down..

@StrikerRUS
Copy link
Collaborator Author

@guolinke
Please, clarify what did you mean under

maybe we should check it [__set_objective_to_none]?

I suppose, Appveyor fails due to the new release (0.20) of scikit-learn which brought new (Deprecation and Future) warnings. I will take a look at this today.

@guolinke
Copy link
Collaborator

@StrikerRUS
__set_objective_to_none means there exists a custom objective function.
In this case, we cannot use refit.
So when calling refit in a booster with __set_objective_to_none, we should throw a error.

@guolinke guolinke merged commit 868b624 into master Oct 2, 2018
@StrikerRUS StrikerRUS deleted the refit branch October 2, 2018 09:38
@lock lock bot locked as resolved and limited conversation to collaborators Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[python] copy info from old Booster to new one in refit method
2 participants