I used xgboost 1.4.2 python version XGBClassifier to train a model and save it as bst file. Then use xgboost4j (version 1.5) to load the bst model to make a prediction. missing value is set to -1.0 during prediction for both java and python.
All feature values are float values.
I noticed the prediction scores from java are different from python code for one of my models. I did not see this issue before for my other 7 xgboost models.
What could cause this issue for this particular model?
I did not specify “missing” parameter in XGBClassifier during training.
Will it fix this difference if missing=-1 is added XGBClassifier during training?
model = xgb.XGBClassifier(objective= ‘binary:logistic’,
Below are some examples : expected_score is from python prediction, score is from xgboost4j prediction. The features are exactly same in each case.
negative cases :