xgb_model_eval.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/sh
  2. start_date=""
  3. end_date=""
  4. feature_file=""
  5. if(($#==3))
  6. then
  7. start_date=$1
  8. end_date=$2
  9. feature_file=$3
  10. else
  11. exit -1
  12. fi
  13. # env
  14. export HADOOP_CONF_DIR=/etc/taihao-apps/hadoop-conf
  15. export JAVA_HOME=/usr/lib/jvm/java-1.8.0
  16. # params
  17. base_data_path=/dw/recommend/model/ad_display/sample
  18. model_path=/dw/recommend/model/ad_display/model/model_xgb
  19. minCnt=0
  20. repartition=10
  21. save_path=/dw/recommend/model/ad_display/eval
  22. # params
  23. test_data_path=""
  24. for((i=0; i<=21; i++))
  25. do
  26. data_date=$(date -d "$start_date $i day" +"%Y%m%d")
  27. if [ "$data_date" -le "$end_date" ]
  28. then
  29. one_day_data_path="${base_data_path}/${data_date}"
  30. if [[ -z $test_data_path ]]
  31. then
  32. test_data_path=$one_day_data_path
  33. else
  34. test_data_path="$test_data_path,$one_day_data_path"
  35. fi
  36. fi
  37. done
  38. echo `date` "predict gender sample"
  39. set -x
  40. /opt/apps/SPARK3/spark-3.3.1-hadoop3.2-1.0.5/bin/spark-class org.apache.spark.deploy.SparkSubmit \
  41. --class com.tzld.piaoquan.recommend.model.pred_profile_gender_xgb_20251114 \
  42. --master yarn --driver-memory 2G --executor-memory 4G --executor-cores 1 --num-executors 8 \
  43. --conf spark.yarn.executor.memoryoverhead=1024 \
  44. --conf spark.shuffle.service.enabled=true \
  45. --conf spark.shuffle.service.port=7337 \
  46. --conf spark.shuffle.consolidateFiles=true \
  47. --conf spark.shuffle.manager=sort \
  48. --conf spark.storage.memoryFraction=0.4 \
  49. --conf spark.shuffle.memoryFraction=0.5 \
  50. --conf spark.default.parallelism=200 \
  51. --conf spark.debug.maxToStringFields=100 \
  52. --files ${feature_file} \
  53. /mnt/disk1/jch/recommend-model/recommend-model-produce/target/recommend-model-produce-jar-with-dependencies.jar \
  54. modelPath:${model_path} \
  55. testPath:${test_data_path} \
  56. featureFile:${feature_file} \
  57. minCnt:${minCnt} \
  58. savePath:${save_path} \
  59. repartition:${repartition} \