ad_model_run.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/bash
  2. source ~/.bash_profile
  3. conda activate rov-offline-py38
  4. cd /data/rov-offline
  5. now_date=`date +"%Y%m%d"`
  6. echo "now_date: $now_date"
  7. # 1. 下载训练所用特征数据并做处理
  8. echo "ad_feature_process start..."
  9. python ad_feature_process.py
  10. if [ $? -ne 0 ];
  11. then
  12. msg = "[ERROR] ad_feature_process.py"
  13. echo $msg
  14. exit -1
  15. fi
  16. echo "ad_feature_process end!"
  17. # 2. 对样本进行采样
  18. echo "ad_feature_data_sample start..."
  19. python ad_feature_data_sample.py
  20. if [ $? -ne 0 ];
  21. then
  22. msg = "[ERROR] ad_feature_data_sample.py"
  23. echo $msg
  24. exit -1
  25. fi
  26. echo "ad_feature_data_sample end!"
  27. # 3. 训练集和测试集生成
  28. echo "ad_generate_train_test start..."
  29. python ad_generate_train_test.py
  30. if [ $? -ne 0 ];
  31. then
  32. msg = "[ERROR] ad_generate_train_test.py"
  33. echo $msg
  34. exit -1
  35. fi
  36. echo "ad_generate_train_test end!"
  37. # 4. 模型训练
  38. echo "ad_xgboost_train start..."
  39. python ad_xgboost_train.py
  40. if [ $? -ne 0 ];
  41. then
  42. msg = "[ERROR] ad_xgboost_train.py"
  43. echo $msg
  44. exit -1
  45. fi
  46. echo "ad_xgboost_train end!"
  47. ## 5. 离线预测数据处理
  48. #echo "ad_predict_video_data_process start..."
  49. #python ad_predict_video_data_process.py
  50. #if [ $? -ne 0 ];
  51. #then
  52. # msg = "[ERROR] ad_predict_video_data_process.py"
  53. # echo $msg
  54. # exit -1
  55. #fi
  56. #echo "ad_predict_video_data_process end!"
  57. #
  58. #echo "ad_predict_user_data_process start..."
  59. #python ad_predict_user_data_process.py
  60. #if [ $? -ne 0 ];
  61. #then
  62. # msg = "[ERROR] ad_predict_user_data_process.py"
  63. # echo $msg
  64. # exit -1
  65. #fi
  66. #echo "ad_predict_user_data_process end!"
  67. #
  68. #echo "ad_xgboost_predict_data_generate start..."
  69. #python ad_xgboost_predict_data_generate.py
  70. #if [ $? -ne 0 ];
  71. #then
  72. # msg = "[ERROR] ad_xgboost_predict_data_generate.py"
  73. # echo $msg
  74. # exit -1
  75. #fi
  76. #echo "ad_xgboost_predict_data_generate end!"
  77. ## 6. 离线预测
  78. #echo "ad_xgboost_predict start..."
  79. #python ad_xgboost_predict.py
  80. #if [ $? -ne 0 ];
  81. #then
  82. # msg = "[ERROR] ad_xgboost_predict.py"
  83. # echo $msg
  84. # exit -1
  85. #fi
  86. #echo "ad_xgboost_predict end!"