#!/bin/sh
set -e
set -x

day=$1
train_path=$2
model_name=$3
output_file=$4
bias=$5
HADOOP="/opt/apps/HADOOP-COMMON/hadoop-common-current/bin/hadoop"
$HADOOP fs -text ${train_path}/${day}/* | /root/sunmingze/alphaFM/bin/fm_predict -m model/$model_name -dim ${bias} -core 8 -out predict/${output_file}_$day.txt
cat predict/${output_file}_$day.txt | /root/sunmingze/AUC/AUC


# nohup sh 03_predict.sh 20240707 /dw/recommend/model/43_recsys_train_data/ model_nba8_20240706.txt model_nba8_20240706 8 >p3_model_nba8_20240706.log 2>&1 &
# nohup sh 03_predict.sh 20240707 /dw/recommend/model/43_recsys_train_data/ model_nba12_20240706.txt model_nba12_20240706 12 >p3_model_nba12_20240706.log 2>&1 &
# nohup sh 03_predict.sh 20240613 /dw/recommend/model/16_train_data/ model_aka8_20240612.txt model_aka8_20240612 8 >p3_model_aka8_12.log 2>&1 &


# nohup sh 03_predict.sh 20240703 /dw/recommend/model/33_ad_train_data_v3/ model_bkb0_v3_20240702.txt model_bkb0_v3_20240702 0 >p3_model_bkb0_v3.log 2>&1 &




# cat tmpfile | /root/sunmingze/alphaFM/bin/fm_predict -m model/model_bkb0_20240622.txt -dim 0 -core 1 -out tmpfile_out.txt


# nohup sh 03_predict.sh 20240629 /dw/recommend/model/33_for_check_v1/ model_bkb0_20240622.txt v1 0 >v1.log 2>&1 &
# nohup sh 03_predict.sh 20240629 /dw/recommend/model/33_for_check_v2/ model_bkb0_20240622.txt v2 0 >v2.log 2>&1 &
# nohup sh 03_predict.sh 20240629 /dw/recommend/model/33_for_check_v3/ model_bkb0_20240622.txt v3 0 >v3.log 2>&1 &
# nohup sh 03_predict.sh 20240627 /dw/recommend/model/33_for_check_v4/ model_bkb0_20240622.txt v4 0 >v4.log 2>&1 &
# nohup sh 03_predict.sh 20240627 /dw/recommend/model/33_for_check_v5/ model_bkb0_20240622.txt v4 0 >v5.log 2>&1 &
# nohup sh 03_predict.sh 20240627 /dw/recommend/model/33_for_check_v6/ model_bkb0_20240622.txt v4 0 >v6.log 2>&1 &

# nohup sh 03_predict.sh 20240626 /dw/recommend/model/17_for_check_v1/ model_aka8_20240608.txt v1 8 >v1.log 2>&1 &
# nohup sh 03_predict.sh 20240626 /dw/recommend/model/17_for_check_v2/ model_aka8_20240608.txt v2 8 >v2.log 2>&1 &
# nohup sh 03_predict.sh 20240626 /dw/recommend/model/17_for_check_v3/ model_aka8_20240608.txt v3 8 >v3.log 2>&1 &
# nohup sh 03_predict.sh 20240626 /dw/recommend/model/17_for_check_v4/ model_aka8_20240608.txt v4 8 >v4.log 2>&1 &
# nohup sh 03_predict.sh 20240626 /dw/recommend/model/17_for_check_v5/ model_aka8_20240608.txt v4 8 >v5.log 2>&1 &
# nohup sh 03_predict.sh 20240626 /dw/recommend/model/17_for_check_v6/ model_aka8_20240608.txt v4 8 >v6.log 2>&1 &




# nohup sh 03_predict.sh 20240630 /dw/recommend/model/33_ad_train_data/ model_bkb0_20240622.txt model_bkb0_20240622 0 >p3_model_bkb0.log 2>&1 &
# nohup sh 03_predict.sh 20240630 /dw/recommend/model/33_ad_train_data/ model_bkb4_20240620.txt model_bkb4_20240620 4 >p3_model_bkb4.log 2>&1 &
# nohup sh 03_predict.sh 20240624 /dw/recommend/model/33_ad_train_data/ model_bkb8_20240622.txt model_bkb8_20240622 8 >p3_model_bkb8.log 2>&1 &
# nohup sh 03_predict.sh 20240621 /dw/recommend/model/33_ad_train_data/ model_bkb12_20240620.txt model_bkb12_20240620 12 >p3_model_bkb12.log 2>&1 &
# nohup sh 03_predict.sh 20240621 /dw/recommend/model/33_ad_train_data/ model_bkb16_20240620.txt model_bkb16_20240620 16 >p3_model_bkb16.log 2>&1 &