Fix bug with gpu_predictor caching behaviour (#3177)

* Fixes #3162
This commit is contained in:
Rory Mitchell
2018-03-18 10:35:10 +13:00
committed by GitHub
parent cdc036b752
commit 9fa45d3a9c
2 changed files with 37 additions and 34 deletions

View File

@@ -1,5 +1,4 @@
import numpy as np
import random
import xgboost as xgb
import testing as tm
from nose.tools import raises
@@ -91,10 +90,6 @@ def test_feature_importances():
xgb_model = xgb.XGBClassifier(seed=0).fit(X, y)
np.testing.assert_almost_equal(xgb_model.feature_importances_, exp)
# string columns, the feature order must be kept
chars = list('abcdefghijklmnopqrstuvwxyz')
X.columns = ["".join(random.sample(chars, 5)) for x in range(64)]
xgb_model = xgb.XGBClassifier(seed=0).fit(X, y)
np.testing.assert_almost_equal(xgb_model.feature_importances_, exp)