My XGBClassifier params is:
params = {
"objective":"multi:softmax",
"n_estimators":100,
"num_class": 9,
"enable_categorical":True,
"eval_metric":accuracy_score,
"max_depth":6,
"seed":1427,
"early_stopping_rounds":10
}
model = xgb.XGBClassifier(**params)
model.fit(X_train, y_train, eval_set=[(X_train,y_train),(X_val, y_val)],verbose=False)
My test data sample is:
|index|feature_0|feature_1|feature_2|feature_3|
|:—-|:—-|:—-|:—-|:—-|
|0|1 |1 | 0 |3 |
|1|2 |3 | 1 |0 |
First time I just select the top one data into predict_proba(),and the result is:
array([[0.10736039, 0.08299389, 0.27829173, 0.08618846, 0.1116927 , 0.08397956, 0.08298932, 0.08341705, 0.08308697]], dtype=float32)
Second time I select the top two data into predict_proba(),and the result is :
array([[0.12672342, 0.0979623 , 0.09857577, 0.11022376, 0.13183711, 0.09912575, 0.09795693, 0.09846178, 0.13913316], [0.07068667, 0.0705675 , 0.23662409, 0.07328377, 0.09496933, 0.0714056 , 0.07056363, 0.24125275, 0.07064665]], dtype=float32)
The top one data in two predict_proba() result is totally different. Why is that?