diff --git a/hang b/hang new file mode 100644 index 000000000000..9541ce7c91ad --- /dev/null +++ b/hang @@ -0,0 +1 @@ +81234168284343979873719512816958541056 \ No newline at end of file diff --git a/tests/python/test_predict.py b/tests/python/test_predict.py index 1f44bc465ec2..ddde67022dea 100644 --- a/tests/python/test_predict.py +++ b/tests/python/test_predict.py @@ -38,6 +38,10 @@ def run_predict_leaf(predictor): 'predictor': predictor, 'tree_method': 'hist'}, m, num_boost_round=num_boost_round) + empty = xgb.DMatrix(np.ones(shape=(0, cols))) + empty_leaf = booster.predict(empty, pred_leaf=True) + assert empty_leaf.shape[0] == 0 + leaf = booster.predict(m, pred_leaf=True) assert leaf.shape[0] == rows assert leaf.shape[1] == classes * num_parallel_tree * num_boost_round