#! /bin/bash Method="COC81" Style="precise" DoStratify=1 DoNFold=1 Path="~/var/fssExperiment" rm -r $Path mkdir -p $Path"/log" mkdir -p $Path"/data/test" mkdir -p $Path"/data/train" DataPath=$Path"/data" mkdir -p $Path"/ranking/sorted" # output the first line of the csv output describing the field names #echo "#FILENAME,I,LEARNER,SEARCH,HORIZON,RANKER,EVAL,MMRE,SD(MRE),PRED30,CORR,COLUMNS" #echo "#FILENAME,I,SEED,LEARNER,SUBSET,ESTIMATE,ACTUAL,MRE" echo "#FILENAME,I,TIME,LEARNER,SUBSET,ESTIMATE,ACTUAL,MRE" #FILENAME,I,LEARNER,SEARCH,HORIZON,RANKER,EVAL,MMRE,SD(MRE),PRED30,CORR,COLUMNS,TIME # Preprocess the full coc81 and nasa93 datasets #cp data/coc81modetypelangtype.csv $DataPath"/coc81_all.csv" cp data/coc81modetypelangtype.csv $DataPath"/coc81_all.csv" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/coc81_all.csv" > $DataPath"/coc81_all.csv.numeric" cp data/nasa93.csv $DataPath"/nasa93_all.csv" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_all.csv" > $DataPath"/nasa93_all.csv.numeric" if (($DoStratify==1)) then #Make the subsets of coc81 data gawk -f csvsubset.awk Col="kind" Want="min" data/coc81modetypelangtype.csv > $DataPath"/coc81_kind_min.csv" gawk -f csvsubset.awk Col="lang" Want="ftn" data/coc81modetypelangtype.csv > $DataPath"/coc81_lang_ftn.csv" gawk -f csvsubset.awk Col="mode" Want="e" data/coc81modetypelangtype.csv > $DataPath"/coc81_mode_e.csv" gawk -f csvsubset.awk Col="kind" Want="max" data/coc81modetypelangtype.csv > $DataPath"/coc81_kind_max.csv" gawk -f csvsubset.awk Col="mode" Want="org" data/coc81modetypelangtype.csv > $DataPath"/coc81_mode_org.csv" gawk -f csvsubset.awk Col="lang" Want="mol" data/coc81modetypelangtype.csv > $DataPath"/coc81_lang_mol.csv" #Convert the subsets of coc81 data to numbers gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/coc81_kind_min.csv" > $DataPath"/coc81_kind_min.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/coc81_lang_ftn.csv" > $DataPath"/coc81_lang_ftn.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/coc81_mode_e.csv" > $DataPath"/coc81_mode_e.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/coc81_kind_max.csv" > $DataPath"/coc81_kind_max.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/coc81_mode_org.csv" > $DataPath"/coc81_mode_org.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/coc81_lang_mol.csv" > $DataPath"/coc81_lang_mol.csv.numeric" #Make the subsets of nasa93 data gawk -f csvsubset.awk Col="projectname" Want="gro" data/nasa93.csv > $DataPath"/nasa93_project_gro.csv" gawk -f csvsubset.awk Col="cat2" Want="missionplanning" data/nasa93.csv > $DataPath"/nasa93_cat2_missionplanning.csv" gawk -f csvsubset.awk Col="cat2" Want="avionicsmonitoring" data/nasa93.csv > $DataPath"/nasa93_cat2_avionicsmonitoring.csv" gawk -f csvsubset.awk Col="mode" Want="semidetached" data/nasa93.csv > $DataPath"/nasa93_mode_semidetached.csv" gawk -f csvsubset.awk Col="projectname" Want="sts" data/nasa93.csv > $DataPath"/nasa93_project_sts.csv" gawk -f csvsubset.awk Col="forg" Want="g" data/nasa93.csv > $DataPath"/nasa93_forg_g.csv" gawk -f csvsubset.awk Col="center" Want="5" data/nasa93.csv > $DataPath"/nasa93_center_5.csv" gawk -f csvsubset.awk Col="year" Want="1975" data/nasa93.csv > $DataPath"/nasa93_year_1975.csv" gawk -f csvsubset.awk Col="year" Want="1980" data/nasa93.csv > $DataPath"/nasa93_year_1980.csv" gawk -f csvsubset.awk Col="mode" Want="embedded" data/nasa93.csv > $DataPath"/nasa93_mode_embedded.csv" gawk -f csvsubset.awk Col="center" Want="2" data/nasa93.csv > $DataPath"/nasa93_center_2.csv" #Convert the subsets of nasa93 data to numbers gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_project_gro.csv" > $DataPath"/nasa93_project_gro.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_cat2_missionplanning.csv" > $DataPath"/nasa93_cat2_missionplanning.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_cat2_avionicsmonitoring.csv" > $DataPath"/nasa93_cat2_avionicsmonitoring.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_mode_semidetached.csv" > $DataPath"/nasa93_mode_semidetached.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_project_sts.csv" > $DataPath"/nasa93_project_sts.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_forg_g.csv" > $DataPath"/nasa93_forg_g.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_center_5.csv" > $DataPath"/nasa93_center_5.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_year_1975.csv" > $DataPath"/nasa93_year_1975.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_year_1980.csv" > $DataPath"/nasa93_year_1980.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_mode_embedded.csv" > $DataPath"/nasa93_mode_embedded.csv.numeric" gawk -f convertcsv.awk Method=$Method Style=$Style $DataPath"/nasa93_center_2.csv" > $DataPath"/nasa93_center_2.csv.numeric" fi if (($DoNFold==1)) then # try nfold on full datasets ./nfold $Path "coc81_all.csv" ./nfold $Path "nasa93_all.csv" if (($DoStratify==1)) then # nfold on coc81 data subsets ./nfold $Path "coc81_kind_min.csv" ./nfold $Path "coc81_lang_ftn.csv" ./nfold $Path "coc81_mode_e.csv" ./nfold $Path "coc81_kind_max.csv" ./nfold $Path "coc81_mode_org.csv" ./nfold $Path "coc81_lang_mol.csv" # nfold on nasa93 data subsets ./nfold $Path "nasa93_project_gro.csv" ./nfold $Path "nasa93_cat2_missionplanning.csv" ./nfold $Path "nasa93_cat2_avionicsmonitoring.csv" ./nfold $Path "nasa93_mode_semidetached.csv" ./nfold $Path "nasa93_project_sts.csv" ./nfold $Path "nasa93_forg_g.csv" ./nfold $Path "nasa93_center_5.csv" ./nfold $Path "nasa93_year_1975.csv" ./nfold $Path "nasa93_year_1980.csv" ./nfold $Path "nasa93_mode_embedded.csv" ./nfold $Path "nasa93_center_2.csv" fi exit fi # try learners on full datasets ./learners $Path "coc81_all.csv" ./learners $Path "nasa93_all.csv" if (($DoStratify==1)) then # learners on coc81 data subsets ./learners $Path "coc81_kind_min.csv" ./learners $Path "coc81_lang_ftn.csv" ./learners $Path "coc81_mode_e.csv" ./learners $Path "coc81_kind_max.csv" ./learners $Path "coc81_mode_org.csv" ./learners $Path "coc81_lang_mol.csv" # learners on nasa93 data subsets ./learners $Path "nasa93_project_gro.csv" ./learners $Path "nasa93_cat2_missionplanning.csv" ./learners $Path "nasa93_cat2_avionicsmonitoring.csv" ./learners $Path "nasa93_mode_semidetached.csv" ./learners $Path "nasa93_project_sts.csv" ./learners $Path "nasa93_forg_g.csv" ./learners $Path "nasa93_center_5.csv" ./learners $Path "nasa93_year_1975.csv" ./learners $Path "nasa93_year_1980.csv" ./learners $Path "nasa93_mode_embedded.csv" ./learners $Path "nasa93_center_2.csv" fi