I train a simple xgboost classifier model with the following lines.
xgb_model = xgb.XGBClassifier(objective="binary:logistic", random_state=42)
xgb_model.fit(X_train, y_train)
ypred_1 = xgb_model.predict(X_test_1)
ypred_2 = xgb_model.predict(X_test_2)
Then I use two test data sets, of which X_test_2 is a subset of X_test_1. When predicting the two test data sets, the model gives different predictions for some samples (which are identical in both data sets). Even if I run the predictions in batches, the different predicted samples differ depending on the batch size. Only when I predict both test data sets in samples, the predictions are the same for all samples. The same behavior was also observed when using XGboost.DMatrix.
Does anyone have an explanation for this behavior?