run_maxwell_simulation_stats.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #! bin/bash
  2. # file which contains model names we want to use for simulation
  3. simulate_models="simulate_models.csv"
  4. # selection of four scenes (only maxwell)
  5. scenes="A, D, G, H"
  6. feature="sub_blocks_stats_reduced"
  7. start_index=0
  8. end_index=24
  9. number=24
  10. for nb_zones in {4,6,8,10,12}; do
  11. for mode in {"svd","svdn","svdne"}; do
  12. for model in {"svm_model","ensemble_model","ensemble_model_v2"}; do
  13. FILENAME="data/${model}_N${number}_B${start_index}_E${end_index}_nb_zones_${nb_zones}_${feature}_${mode}"
  14. MODEL_NAME="${model}_N${number}_B${start_index}_E${end_index}_nb_zones_${nb_zones}_${feature}_${mode}"
  15. if grep -xq "${MODEL_NAME}" "${simulate_models}"; then
  16. echo "Run simulation for model ${MODEL_NAME}"
  17. # by default regenerate model
  18. python generate/generate_data_model_random.py --output ${FILENAME} --interval "${start_index},${end_index}" --kind ${mode} --feature ${feature} --scenes "${scenes}" --nb_zones "${nb_zones}" --percent 1 --renderer "maxwell" --random 1
  19. python train_model.py --data ${FILENAME} --output ${MODEL_NAME} --choice ${model}
  20. python prediction/predict_seuil_expe_maxwell_curve.py --interval "${start_index},${end_index}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature} --limit_detection '2'
  21. python others/save_model_result_in_md_maxwell.py --interval "${start_index},${end_index}" --model "saved_models/${MODEL_NAME}.joblib" --mode "${mode}" --feature ${feature}
  22. fi
  23. done
  24. done
  25. done