1from sklearn.model_selection import cross_val_predict
2xgb=XGBClassifier(colsample_bytree=0.8, learning_rate=0.4, max_depth=4)
3cvs=cross_val_score(xgb,x,y,scoring='accuracy',cv=10)
4print('cross_val_scores= ',cvs.mean())
5y_pred=cross_val_predict(xgb,x,y,cv=10)
6conf_mat=confusion_matrix(y_pred,y)
7conf_mat