-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[R-package] allow access to params in Booster #3662
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Shouldn't prevent to merge this PR) but I just want to say that a more general fix will be loading params from cpp side: #2613 (comment) |
jameslamb
requested review from
btrotta,
chivee,
henry0312,
StrikerRUS and
wxchan
as code owners
December 22, 2020 04:06
jameslamb
commented
Dec 22, 2020
jameslamb
commented
Dec 22, 2020
guolinke
approved these changes
Jan 3, 2021
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been trying to check LightGBM questions on Stack Overflow more frequently. A search today led me to this question from two years ago: https://stackoverflow.com/questions/49674112/accessing-lightgbm-model-parameters/50115384#50115384.
It pointed out that there's no way to access the parameters from
Booster
object. This is something that the Python package has had for a while.Storing the parameters in the Booster can be helpful for cases where you've saved a model and then later load it in a session that doesn't have the original training code available. For example, you might want to be sure that the parameters you use for training continuation are the same as those you used in the original training. Or you might want to use parameters as metadata in a model monitoring system.
This pull request adds a new public attribute,
Booster$params
. Just likeBooster.params
in the Python package, it includes all passed-in parameters AND any parameters on the Dataset used for training (such asmax_bin
).This PR also adds the first set of tests on
saveRDS.lgb.booster()
andreadRDS.lgb.booster()
, which were previously not covered by any tests.