[R] Error out on unrecognized arguments and ...
parameters
#11074
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.
ref #9810
closes #10563
As a follow up from #11072
(requires changes from that PR)
This PR modifies the logic of xgboost functions to:
params
argument (save forxgboost()
).feval
tocustom_metric
like it was done in the python package.xgb.params
constructor for all tests and examples whenever possible.Motivation
After all the changes in the R interface, we've now refocused
xgb.train
to be a low-level function that should stay as close as possible to the xgboost core library and the other language bindings and which should be preferred for production usage, while we now havexgboost()
which is the user-friendly version following R idioms and meant for interactive usage.Given that
xgb.train()
is a more low-level and production-oriented function, one would not want to find surprising or strange behaviors on it, such as silently accepting a parameter which is not used, or having undocumented...
parameters, or bumping into undefined behavior when something is passed as both...
andparams
.As another motivation, the python package does not allow
*args
or**kwargs
to pass parameters toxgb.train
- this would make the R interface calls look more similar to those of other interfaces.Even in XGBoost's own test suite, there have been many tests that were using removed arguments and no one noticed due to this behavior of accepting all arguments. The changes here allowed catching a few more tests that had unused parameters.
Since it might not be obvious that some arguments have been renamed, and this will be the first CRAN release to use the renamed versions, it would be quite helpful to throw informative errors to users and library authors such that they would know how to change their code.