Handle np integer in model slice and prediction. (#10007)

This commit is contained in:
Jiaming Yuan
2024-01-26 04:58:48 +08:00
committed by GitHub
parent a76d6c6131
commit 65d7bf2dfe
7 changed files with 75 additions and 49 deletions

View File

@@ -440,7 +440,7 @@ def test_regression():
preds = xgb_model.predict(X[test_index])
# test other params in XGBRegressor().fit
preds2 = xgb_model.predict(
X[test_index], output_margin=True, iteration_range=(0, 3)
X[test_index], output_margin=True, iteration_range=(0, np.int16(3))
)
preds3 = xgb_model.predict(
X[test_index], output_margin=True, iteration_range=None