printing auc of train and val datasets post model training using XGBClassifier

Viewed 18

I've used XGBClassifier to train a model using model.fit command and eval_metric as 'auc'.

model = XGBClassifier(learning_rate =0.1,n_estimators=1000, max_depth=5,min_child_weight=1,gamma=0,subsample=0.8,colsample_bytree=0.8,objective= 'binary:logistic',booster='gbtree',eval_metric='auc', early_stopping_rounds=20)

model.fit(X_train, Y_train, eval_set=[(X_train, Y_train),(X_test, Y_test)])

The model trained along with displaying auc values of train and val datasets as below.

..... [950] validation_0-auc: 0.789111 validation_1-auc: 0.789002 .....

Now, if I've to explicitly print the auc of the train/val set (corresponding to a specific tree or even overall at 1000 trees), which command should I use?

Context: The run that displayed the auc values for each tree is not available to me for some reason while I have the model saved. So, I don't know what's the auc I got while training, and hence need to check that.

0 Answers
Related