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] Check parameters in cb.reset.parameters() #2665

Closed
jameslamb opened this issue Jan 4, 2020 · 1 comment
Closed

[R-package] Check parameters in cb.reset.parameters() #2665

jameslamb opened this issue Jan 4, 2020 · 1 comment

Comments

@jameslamb
Copy link
Collaborator

Summary

When passing a list of parameters to cb.reset.parameters(), that function should validate the list that you pass in.

Motivation

Currently, it's possible to use cb.reset.parameters() to sneak bad parameters (e.g. negative num_leaves) into a LightGBM model. Sometimes you might catch this because an error will be thrown elsewhere, but in other cases your code might run but produce incorrect results.

Description

To close this issue, add some code that checks params in cb.reset.parameters() (R-package/R/callback.R). To avoid duplicate code and inconsistencies, it might be valuable to centralize that logic in an internal function like .check_params(params), which then also gets used in lgb.train() and lgb.cv().

References

A centralized parameter-checking function as described in the description section did once exist in the R package (lgb.check.params()) but it was empty. That function was removed in #2652 .

@jameslamb
Copy link
Collaborator Author

Closed in favor of being in #2302. We decided to keep all feature requests in one place.

Welcome to contribute this feature! Please re-open this issue (or post a comment) if you are actively working on implementing this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant