|
@@ -130,6 +130,33 @@ init() {
|
|
|
echo "当前Python环境安装的三方包: $(python -m pip list)"
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+check_run_status() {
|
|
|
+ local status=$1
|
|
|
+ local step_start_time=$2
|
|
|
+ local step_name=$3
|
|
|
+ local msg=$4
|
|
|
+
|
|
|
+ local step_end_time=$(date +%s)
|
|
|
+ local step_elapsed=$(($step_end_time - $step_start_time))
|
|
|
+
|
|
|
+ if [[ -n "${old_auc}" && "${old_auc}" != "0" ]]; then
|
|
|
+ msg+="\n\t - 老模型AUC: ${old_auc}"
|
|
|
+ fi
|
|
|
+ if [[ -n "${new_auc}" && "${new_auc}" != "0" ]]; then
|
|
|
+ msg+="\n\t - 新模型AUC: ${new_auc}"
|
|
|
+ fi
|
|
|
+
|
|
|
+
|
|
|
+ if [ ${status} -ne 0 ]; then
|
|
|
+ local elapsed=$(($step_end_time - $start_time))
|
|
|
+ echo "${LOG_PREFIX} -- ${step_name}失败: 耗时 ${step_elapsed}, msg: ${msg}, 总耗时: ${elapsed}"
|
|
|
+ exit 1
|
|
|
+ else
|
|
|
+ echo "${LOG_PREFIX} -- ${step_name}成功: 耗时 ${step_elapsed}"
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
xgb_train() {
|
|
|
local step_start_time=$(date +%s)
|
|
|
|