XGBoost Predictions

I am working on a multi-class classification task for 24 classes using XGBoost. I am training the model as follows:

param = {'max_depth': max_depth, 'eta': learning_rate, 'silent': 1, 'objective': 'multi:softmax', 'num_class': 24}
bst = xgb.train(param, dtrain, num_round)
bst = xgb.Booster({'nthread': 4})
predictions = bst.predict(dval)


I am getting the predictions as this array:

[ 0.5  0.5  0.5 ...,  0.5  0.5  0.5]


I don't know why it's predicting all classes as 0.5 instead of one of the indices in 0 to 23. Do I need to use any other objective parameter?

• What is the line bst = xgb.Booster({'nthread': 4}) for? – tagoma Nov 26 '17 at 21:16

bst = xgb.Booster({'nthread': 4})