-
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] deprecate the use of 'info' in Dataset #4573
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b030e4a
[R-package] introduce keyword arguments for Dataset properties
jameslamb f285909
fix conflicts
jameslamb e4385ba
adding examples
jameslamb 8347fb2
Merge branch 'master' into feat/dataset-args
jameslamb 6fba8d4
trying to fix loading issues
jameslamb 965fd83
add check on use of info and fix examples
jameslamb 7eef3a9
eliminate one '...'
jameslamb c8212d8
Update R-package/R/lgb.Dataset.R
jameslamb a96354b
Update R-package/R/lgb.Dataset.R
jameslamb d42b3cf
Merge branch 'master' into feat/dataset-args
jameslamb 75012cc
Merge branch 'feat/dataset-args' of github.com:microsoft/LightGBM int…
jameslamb 9f4f253
Dataset get_params() is public
jameslamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Looks like additional params like
min_data
are lost here before 4.0.0 release.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.
oh! I don't think so, but it's not obvious at all what I did, so let me share some links.
First,
Dataset
in the R package is not exported, so its constructor can be considered "private" in the package's API. That isn't true for any other public methods on this class, since they can be called by user code once a function likelgb.Dataset()
returns aDataset
. So as long as all the exported methods / functions maintain backwards-compatibility, no user code will be broken.Since this PR adds each of the elements of
INFO_KEYS
as keyword arguments inDataset$new()
, the only thing that could be left in...
is information you want to include in params.As of this PR, exported entrypoints that create a
Dataset
will handle mergingparams
and...
before callingDataset$new()
.Dataset$create_valid()
LightGBM/R-package/R/lgb.Dataset.R
Lines 136 to 156 in c8212d8
lgb.Dataset()
LightGBM/R-package/R/lgb.Dataset.R
Lines 798 to 826 in c8212d8
=====
this made me realize that one place,
Dataset$slice()
, is missing the "combine params before callingDataset$new()
logic. I'll open a separate PR for that.LightGBM/R-package/R/lgb.Dataset.R
Lines 501 to 527 in 32445ab
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.
Ah, here is the key point! Thanks a lot for as always detailed explanation!