mirror of
https://github.com/Doctorado-ML/Stree_datasets.git
synced 2025-08-15 23:46:03 +00:00
37 lines
1.3 KiB
Bash
Executable File
37 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ] ; then
|
|
echo "Hay que seleccionar:"
|
|
echo " - el tipo de experimento {gridsearch, gridbest, cross}"
|
|
echo " - el modelo {stree, adaBoost, bagging, odte}"
|
|
echo " - el kernel {linear, poly, rbf, any}"
|
|
echo " - el tipo de plataforma {pbs, slurm}"
|
|
exit 1
|
|
fi
|
|
if [[ ! "gridsearchgridbestcross" == *$1* ]] ; then
|
|
echo "Hay que seleccionar el tipo de experimento {gridsearch, gridbest, cross}"
|
|
exit 1
|
|
fi
|
|
if [[ ! "streeadaBoostbaggingodte" == *$2* ]] ; then
|
|
echo "Hay que seleccionar el modelo {stree, adaBoost, bagging, odte}"
|
|
exit 1
|
|
fi
|
|
if [[ ! "linearpolyrbfany" == *$3* ]] ; then
|
|
echo "Hay que seleccionar el kernel {linear, poly, rbf, any}"
|
|
exit 1
|
|
fi
|
|
if [[ ! "pbsslurm" == *$4* ]] ; then
|
|
echo "Hay que seleccionar la plataforma {pbs, slurm}"
|
|
exit 1
|
|
fi
|
|
script_path="$(pwd)/.."
|
|
cp experiment.$4 experiment_$1.sh
|
|
perl -i -pe"s/<model>/$2/g" experiment_$1.sh
|
|
perl -i -pe"s~<folder>~$script_path~g" experiment_$1.sh
|
|
perl -i -pe"s/<experiment>/$1/g" experiment_$1.sh
|
|
mkdir -p $1/$2/$3
|
|
cat ../datasets.txt|cut -d " " -f 2|tail -49|while read a; do
|
|
cp experiment_$1.sh $1/$2/$3/experiment_$a.sh
|
|
perl -i -pe"s/<data>/$a/g" $1/$2/$3/experiment_$a.sh
|
|
perl -i -pe"s/<kernel>/$3/g" $1/$2/$3/experiment_$a.sh
|
|
done
|
|
rm experiment_$1.sh |