xgb_model_eval.sh 1.7 KB

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