[R] many minor changes to increase the robustness of the R code (#2404)
* many minor changes to increase robustness of R code * fixing which mistake in xgb.model.dt.tree.R and a few cosmetics
This commit is contained in:
committed by
Vadim Khotilovich
parent
0db37c05bd
commit
cd7659937b
@@ -115,7 +115,7 @@ xgb.importance <- function(feature_names = NULL, model = NULL, trees = NULL,
|
||||
} else {
|
||||
data.table(Feature = rep(feature_names, each = num_class),
|
||||
Weight = weights,
|
||||
Class = 0:(num_class - 1))[order(Class, -abs(Weight))]
|
||||
Class = seq_len(num_class) - 1)[order(Class, -abs(Weight))]
|
||||
}
|
||||
} else {
|
||||
# tree model
|
||||
|
||||
Reference in New Issue
Block a user