xgboost::xgb.model.dt.tree triggers an error if all leaf values are negative.
Open
type: bug
- Dominant language
- C++
- Stars
- 28.8k
- Forks
- 8.9k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 54
Description
Regarding R-package:
I am not sure what the purpose of `sum(grepl("leaf=(\\d+)", text)< 1` in xgboost::xgb.model.dt.tree is but it triggers an error if all leaf values are negative.
Minimal example
```
n <- 50
x1 <- sample(0:1, n, replace=TRUE)
x2 <- sample(0:1, n, replace=TRUE)
x <- cbind(x1,x2)
y <- -(x1+x2)-1
xg <- xgboost(data = cbind(x1,x2), label = y, params = list(max_depth = 4, eta = .1), nrounds = 100,verbose = 0)
xgboost::xgb.model.dt.tree(model = xg, use_int_id = TRUE)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.