-
Notifications
You must be signed in to change notification settings - Fork 630
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
xgboost model warning : ntree_limit
is deprecated, use iteration_range
instead
#1270
Comments
Hello, I also encountered this problem. How did you solve it? |
You can follow this. Just add |
As suggested by missuse "The current warning means xgboost is changing the name of an argument, but caret is still supplying the old name. Currently it works but with new xgboost versions the argument will be completely replaced, if carets function code is not updated by then the warning will be replaced by an error." So, it would be better if carets function code is updated. |
Agreed. I am teaching a class using caret and I think these warnings are confusing for students. |
@topepo Any plans to change this please? Seems a simple one-liner? |
Source of warningThe warning comes when using the Line 164 in 5f4bd20
So yes, @Jon77Ruler, this is an easy fix if However, I am not sure what the repository rules are for these kind of "simple" bug-fixes. @topepo wrote that {caret} is on the "backburner", see issue #1365 - so it might be a while before we get a fix. Its not breaking "issue" yet, but it might be in the future. Demonstration of problem and solutionlibrary(xgboost) data(
agaricus.train,
package = 'xgboost'
)
data(
agaricus.test,
package = 'xgboost'
)
# + estimate model
simple_model <- xgboost(
data =agaricus.train$data,
label = agaricus.train$label,nrounds = 2
)
#> [1] train-rmse:0.350593
#> [2] train-rmse:0.246082 # + in caret
first <- predict(
simple_model,
agaricus.test$data,
# in caret
ntreelimit = 2
)
#> [10:44:28] WARNING: src/c_api/c_api.cc:935: `ntree_limit` is deprecated, use `iteration_range` instead. second <- predict(
simple_model,
agaricus.test$data,
# in xgboost
iteration_range = 2
) setequal(
first,
second
)
#> [1] TRUE Created on 2024-07-19 with reprex v2.1.0 |
Running
xgboost
model usingcaret
package gives following warningMinimal, reproducible example:
I have tried to use
warning = FALSE
andmessage = FALSE
in the chunk setting. But still, it appears in the knit document. How to remove this warning?Session Info:
The text was updated successfully, but these errors were encountered: