|
@@ -25,17 +25,21 @@ predict_date_path=""
|
|
|
|
|
|
init() {
|
|
|
|
|
|
+ local today_early_1="$(date -d '1 days ago' +%Y%m%d)"
|
|
|
+
|
|
|
predict_date_path=${BUCKET_FEATURE_PATH}/${today_early_1}
|
|
|
|
|
|
local count=1
|
|
|
- local today_early_1="$(date -d '1 days ago' +%Y%m%d)"
|
|
|
# 循环获取前 n 天的非节日日期
|
|
|
while [[ $count -lt 8 ]]; do
|
|
|
date_key=$(date -d "$today_early_1 -${count} day" +%Y%m%d)
|
|
|
- # 判断是否是节日
|
|
|
- if [ $(is_holidays $date_key) -ge 0 ]; then
|
|
|
- # 如果不是节日,添加到数组中
|
|
|
- train_data_path="${BUCKET_FEATURE_PATH}/${date_key},${train_data_path}"
|
|
|
+ # 判断是否是节日,并拼接训练数据路径
|
|
|
+ if [ $(is_not_holidays $date_key) -eq 1 ]; then
|
|
|
+ if [[ -z ${train_data_path} ]]; then
|
|
|
+ train_data_path="${BUCKET_FEATURE_PATH}/${date_key}"
|
|
|
+ else
|
|
|
+ train_data_path="${BUCKET_FEATURE_PATH}/${date_key},${train_data_path}"
|
|
|
+ fi
|
|
|
count=$((count + 1))
|
|
|
else
|
|
|
echo "日期: ${date_key}是节日,跳过"
|
|
@@ -46,11 +50,14 @@ init() {
|
|
|
echo "predict_date_path: ${predict_date_path}"
|
|
|
}
|
|
|
|
|
|
+# xgb_train() {
|
|
|
+
|
|
|
+# }
|
|
|
+
|
|
|
|
|
|
# 主方法
|
|
|
main() {
|
|
|
- init
|
|
|
-
|
|
|
+ init
|
|
|
}
|
|
|
|
|
|
|