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

[R-package] fix warnings in examples #4568

Merged
merged 3 commits into from
Aug 29, 2021
Merged

[R-package] fix warnings in examples #4568

merged 3 commits into from
Aug 29, 2021

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Aug 28, 2021

The deprecation warnings added as part of #4226 introduced some warnings in the examples in {lightgbm}'s documentation.

For example, see https://lightgbm.readthedocs.io/en/latest/R/reference/lgb.train.html

image

This PR fixes them and converts examples to the new pattern we want to encourage as of v3.3.0 (#4310), passing all parameters through params.

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for fixing warnings!
I've checked all @examples in all .R files and found only two issues. I think we can update them in this PR as one of them is super minor and another one is directly related to ... params.

I think we need to assign the following prediction result to some variable

#' # pass other prediction parameters
#' predict(

Looks like a typo because I can't find test parameter. Probably should be label = test$label? I guess there is no warning about test keyword argument because we haven't deprecated ... params in Dataset constructor yet.

#' dtest <- lgb.Dataset(test$data, test = train$label)

@jameslamb
Copy link
Collaborator Author

I think we can update them in this PR

Agree with both of these, thanks! Just pushed ea5ab13 to fix these.

Looks like a typo because I can't find test parameter. Probably should be label = test$label?

Thanks for catching this! Just want to note this is a good example of the value of #4226 . In {lightgbm} 4.0.0, when ... is no longer respected, mistakes like this will become loud errors instead of unrecognized parameters being silently ignored.

@jameslamb jameslamb merged commit b4213e9 into master Aug 29, 2021
@jameslamb jameslamb deleted the r/example-warnings branch August 29, 2021 00:56
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
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.

2 participants