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.
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] enable saving Booster with saveRDS() and loading it with readRDS() (fixes #4296) #4685
[R-package] enable saving Booster with saveRDS() and loading it with readRDS() (fixes #4296) #4685
Changes from 2 commits
4c177a5
ada260b
0d551a0
088eef3
5e2a922
5c1d260
8ed14a6
840de5e
af16b2d
9d7e6f8
4428a23
730f2e6
719af93
41a75bd
9b5de4d
1f4aa91
84af4e7
25557f7
ff78dd2
19f3c4a
2f3a334
6e7b852
617b226
8a078f4
8e194af
d4c8ef1
44ca8db
d6f4c74
8d282e4
0817eb0
f845554
51fa088
8522ce7
c116270
bee5bc1
b0f9f93
2d3a132
c534952
58fd21f
b1b4e2b
eb7fd32
34707ae
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be moved inside
Booster$predict()
?That way, it'll be guaranteed to run regardless of whether someone uses
predict(bst, data)
orbst$predict()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's placed earlier it can throw an error before doing any other long operations with the data. I also assume that since the R6 methods are not documented, they are meant for internal usage, and a user trying to call them directly would likely need to examine the code in any case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only code between this call and
Booster$predict()
is conversion of...
to a list and possibly raising a deprecation warning.I'd prefer to concentrate these
$restore_handle()
calls in theBooster
object as much as possible, to minimize how many places in the package's code need to know about managing the raw model object.The fact that those methods are not documented is a gap that should be filled (not in this PR, please).
However, all of the
Booster
's public methods exceptinitialize()
are treated as part of the public API of the R package. We treat them that way because other exported functions can returnBooster
instance. For example,lgb.train()
returns aBooster
instance, and then user code can call any public methods on that instance without needing to use:::
or reach into$.__enclos_env__$private
.This file was deleted.