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

in XGBoost: iteration_range should be used instead of ntree_limit #1371

Open
shainova opened this issue Sep 4, 2024 · 1 comment
Open

in XGBoost: iteration_range should be used instead of ntree_limit #1371

shainova opened this issue Sep 4, 2024 · 1 comment

Comments

@shainova
Copy link

shainova commented Sep 4, 2024

I get error:
[11:52:40] WARNING: src/c_api/c_api.cc:935: ntree_limit is deprecated, use iteration_range instead.

Running:

train_control <- trainControl(
  method = "cv",           # Cross-validation
  number = 5,              # 5-fold CV
  summaryFunction = balancedAccuracy,  # Use balanced accuracy to evaluate models
  savePredictions = "final"
)

xgb_model <- train(
  y ~ .,
  data = train_data,
  method = "xgbTree",
  trControl = train_control,
  tuneLength = 3  # Number of hyperparameter combinations to try
)
@bappa10085
Copy link

You can follow this. Just add verbosity = 0 within train function. 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 to update the caret function code.

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

No branches or pull requests

2 participants