Fix inplace prediction interval. (#6259)

* Add back the interval in call.
* Make the interval non-optional.
This commit is contained in:
Jiaming Yuan
2020-10-28 13:13:59 +08:00
committed by GitHub
parent cc76724762
commit 3310e208fd
6 changed files with 17 additions and 12 deletions

View File

@@ -44,6 +44,11 @@ class TestInplacePredict(unittest.TestCase):
np.testing.assert_allclose(predt_from_dmatrix, predt_from_array)
predt_from_array = booster.inplace_predict(X[:10, ...], iteration_range=(0, 4))
predt_from_dmatrix = booster.predict(test, ntree_limit=4)
np.testing.assert_allclose(predt_from_dmatrix, predt_from_array)
def predict_dense(x):
inplace_predt = booster.inplace_predict(x)
d = xgb.DMatrix(x)