text_html_output_1.png
from sklearn.metrics import accuracy_score, recall_score

from xgboost import XGBClassifier

from xgboost import XGBClassifier
xgb_clf = XGBClassifier(early_stopping_rounds=3)
xgb_clf.fit(X_train_res, y_train_res, eval_set=[(X_test_res, y_test_res)])
xgb_clf_preds = xgb_clf.predict(X_test_res)
print('Accuracy of XGBoost on validation data : ', recall_score(y_test_res, xgb_clf_preds))
print('XGBoost accuracy on validation data : ', recall_score(y_test, xgb_clf_preds))