dmlc / dmlc/xgboost

Passing `updater` parameter produces warning about ignored `tree_method` even if the latter is not passed

Open
#9,964 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

If one passes parameter `updater`, xgboost will throw a warning about `tree_method` being ignored, even if said parameter is not passed. The warning occurs in both python and R, and happens only the first time that `xgb.train` with said parameter is executed.

```python
import numpy as np, xgboost as xgb
rng = np.random.default_rng(seed=123)
y = rng.integers(2, size=100)
X = rng.standard_normal(size=(100,10))
dm = xgb.DMatrix(X, y)
model = xgb.train(
dtrain=dm,
num_boost_round=10,
params={
"objective" : "binary:logistic",
"max_depth" : 2,
"eta" : 0.05,
"updater" : "grow_colmaker,prune",
}
)
```
```
WARNING: You have manually specified the `updater` parameter. The `tree_method` parameter will be ignored. Incorrect sequence of updaters will produce undefined behavior. For common uses, we recommend using `tree_method` parameter instead.
```

Subsequent executions of the same call to `xgb.train` do not produce the warning twice.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.