Skip to content

Commit

Permalink
[R] Fix warning from DT about mismatched names (#10743)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes authored Sep 28, 2024
1 parent c9f89c4 commit 429f956
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R-package/R/xgb.plot.multi.trees.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@ xgb.plot.multi.trees <- function(model, features_keep = 5, plot_width = NULL, pl

edges.dt <- data.table::rbindlist(
l = list(
tree.matrix[Feature != "Leaf", .(abs.node.position, Yes)],
tree.matrix[Feature != "Leaf", .(abs.node.position, No)]
tree.matrix[Feature != "Leaf", .(From = abs.node.position, To = Yes)],
tree.matrix[Feature != "Leaf", .(From = abs.node.position, To = No)]
)
)
data.table::setnames(edges.dt, c("From", "To"))
edges.dt <- edges.dt[, .N, .(From, To)]
edges.dt[, N := NULL]

Expand Down

0 comments on commit 429f956

Please sign in to comment.