Skip to content

Commit

Permalink
Make the train and test input with same colnames. (#4329)
Browse files Browse the repository at this point in the history
Fix the bug report of #4328.
I am the beginner of the Git so just try my best to follows the guide, https://xgboost.readthedocs.io/en/latest/contribute.html#r-package.
I find there is no `dev`  branch, so I pull this fix from my master branch to the original master branch.
  • Loading branch information
JiaxiangBU authored and hcho3 committed Apr 4, 2019
1 parent 70be1e3 commit 1ca5698
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R-package/demo/predict_leaf_indices.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ create.new.tree.features <- function(model, original.features){
# Convert previous features to one hot encoding
new.features.train <- create.new.tree.features(bst, agaricus.train$data)
new.features.test <- create.new.tree.features(bst, agaricus.test$data)
colnames(new.features.test) <- colnames(new.features.train)

# learning with new features
new.dtrain <- xgb.DMatrix(data = new.features.train, label = agaricus.train$label)
Expand Down

0 comments on commit 1ca5698

Please sign in to comment.