make_train_sample.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. feature_file=""
  3. year=""
  4. if(($#==2))
  5. then
  6. feature_file=$1
  7. year=$2
  8. else
  9. exit -1
  10. fi
  11. set -x
  12. export SPARK_HOME=/opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8
  13. export PATH=$SPARK_HOME/bin:$PATH
  14. export HADOOP_CONF_DIR=/etc/taihao-apps/hadoop-conf
  15. export JAVA_HOME=/usr/lib/jvm/java-1.8.0
  16. # params
  17. readPath=/dw/recommend/model/user_profile/data/
  18. suffix="y,8,4,0,e,a,c,k,o,w,g,s,u,q,i,m"
  19. whatLabel=gender
  20. class="1,2"
  21. minCnt=10
  22. savePath=/dw/recommend/model/user_profile/gender/sample/train/
  23. # 1 生产数据
  24. /opt/apps/SPARK2/spark-2.4.8-hadoop3.2-1.0.8/bin/spark-class2 org.apache.spark.deploy.SparkSubmit \
  25. --class com.aliyun.odps.spark.examples.makedata_recsys_r_rate.makedata_profile_gender_sample_20251114 \
  26. --master yarn --driver-memory 4G --executor-memory 6G --executor-cores 1 --num-executors 8 \
  27. --conf spark.yarn.executor.memoryoverhead=2048 \
  28. --files ${feature_file} \
  29. /mnt/disk1/jch/recommend-emr-dataprocess/target/spark-examples-1.0.0-SNAPSHOT-jar-with-dependencies.jar \
  30. readPath:${readPath} \
  31. year:${year} \
  32. suffix:${suffix} \
  33. whatLabel:${whatLabel} \
  34. class:${class} \
  35. featureFile:${feature_file} \
  36. minCnt:${minCnt} \
  37. repartition:1 \
  38. savePath:${savePath} \