xgb_model_predict.sh 1.5 KB

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