#!/bin/bash # dan: removed space after #! ##this file runs competing learners on the given subset of data Filename=$1 RealTestFile=$2 Path="/tmp/apply" rm -r $Path mkdir $Path echo "got here" pwd LcEstimates=$Path"/lc_estimates.log" CocomostEstimates=$Path"/cocomost_estimates.log" Method="COC81" Style="precise" ConvertedFile=$Path"/converted_data.csv" gawk -f convertcsv.awk Method=$Method Style=$Style $Filename > $ConvertedFile Iterations=30 Mprime="0.1" TestSets=$(gawk -v M=$Mprime 'END{print int(NR*M)}' $ConvertedFile) DoCocomostV2=1 Experts=4 #Run the algorithm many times #for ((i=1;i<=$Iterations;i++)) i=0; for (( i=1;i<=$Iterations;i++ )) do #Randomize Data Seed=$RANDOM legacyTestFile=$ConvertedFile"."$i".test" TrainFile=$ConvertedFile"."$i".train" gawk -f randomize.awk -v Seed=$Seed -v TestSets=$TestSets -v TrainFile=$TrainFile -v TestFile=$legacyTestFile $ConvertedFile # basic Local Calibration TargetEMs="-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-" Result=$(gawk -f simplelc.awk Pass=1 TargetEMs=$TargetEMs $TrainFile Pass=2 TargetEMs=$TargetEMs $RealTestFile) Estimate=$(echo $Result | gawk 'BEGIN{FS=","} NR==1{print $1}') echo $Estimate >> $LcEstimates # FSS with COCOMOST and then LC if (($DoCocomostV2==1)) then TargetEMs=$(./lcFssFilter $TrainFile) Result=$(gawk -f simplelc.awk Pass=1 TargetEMs=$TargetEMs $TrainFile Pass=2 TargetEMs=$TargetEMs $RealTestFile) Estimate=$(echo $Result | gawk 'BEGIN{FS=","} NR==1{print $1}') echo $Estimate >> $CocomostEstimates fi done