# xgboost classifier predicted negative probabilities

I'm using XGBoost for a binary classification problem. There is no negative label, only 1 and 0.

I tunned the hyperparameters using Bayesian optimization then tried to train the final model with the optimized hyperparameters.

Mdl_XGB = xgb.train(OptimizedParams, dtrain)

scores_train = Mdl_XGB.predict(dtrain)

scores_test = Mdl_XGB.predict(dtest)

My problem is that the predicted scores for both train and test sets include both negative values and numbers greater than one. The scores are between -0.23 and 1.13.

Shouldn't these scores present the probability of belonging to class 1 (positive class)?

• Can you include the code for model creation and the outputs? As a side note: the word "scores" might be confusing here since it is usually used for performance scores like accuracy. It is more common to write pred_train = Mdl_XGB.predict(dtrain). – Sammy Mar 4 at 16:49