write gbm_confusion function