run_maxwell_simulation_corr_custom.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #! bin/bash
  2. # file which contains model names we want to use for simulation
  3. simulate_models="simulate_models.csv"
  4. start_index=0
  5. size=24
  6. # selection of four scenes (only maxwell)
  7. scenes="A, D, G, H"
  8. metric="lab"
  9. for label in {"0","1"}; do
  10. for highest in {"0","1"}; do
  11. for nb_zones in {4,6,8,10,12}; do
  12. for size in {5,10,15,20,25,30,35,40}; do
  13. for mode in {"svd","svdn","svdne"}; do
  14. for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
  15. FILENAME="data/${model}_N${size}_B${start_index}_E${size}_nb_zones_${nb_zones}_${metric}_${mode}_corr_L${label}_H${highest}"
  16. MODEL_NAME="${model}_N${size}_B${start_index}_E${size}_nb_zones_${nb_zones}_${metric}_${mode}_corr_L${label}_H${highest}"
  17. CUSTOM_MIN_MAX_FILENAME="${model}_N${size}_B${start_index}_E${size}_nb_zones_${nb_zones}_${metric}_${mode}_corr_L${label}_H${highest}_min_max_values"
  18. echo ${MODEL_NAME}
  19. if grep -xq "${MODEL_NAME}" "${simulate_models}"; then
  20. echo "Run simulation for model ${MODEL_NAME}"
  21. python generate_data_model_corr_random.py --output ${FILENAME} --n ${size} --highest ${highest} --label ${label} --kind ${mode} --metric ${metric} --scenes "${scenes}" --nb_zones "${nb_zones}" --percent 1 --renderer "maxwell" --step 10 --random 1 --custom 1
  22. python train_model.py --data ${FILENAME} --output ${MODEL_NAME} --choice ${model}
  23. python predict_seuil_expe_maxwell_curve.py --interval "${start_index},${size}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --metric ${metric} --limit_detection '2' --custom ${CUSTOM_MIN_MAX_FILENAME}
  24. python save_model_result_in_md_maxwell.py --interval "${start_index},${size}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --metric ${metric}
  25. fi
  26. done
  27. done
  28. done
  29. done
  30. done
  31. done