#! /bin/bash # Example of running cocomin # It expects to have data preprocessed like this. # This is simply an example so I'm using the same file twice, but please try with others. # Dan Baker 2007 # Cocomin is designed to be a very simple and fast heuristic for FSS used with the COCOMO 81 cost estimation models. # It makes one pass over the attributes. # Arguments are either: # trainingFile searchMethod rankMethod evalMethod (Seed) # trainingFile searchMethod rankMethod evalMethod testingFile displayMode (Seed) # Seed is only needed when ranking by Random # When using the first set of arguments (no test file), cocomin will simply return the costDrivers chosen #__DisplayMode_________________Description_______________________ # None When the testingFile and displayMode aren't passed as arguments - Prints costDrivers # 1 Prints estimate for each test record # 2 Prints a,b,costDrivers # 3 Prints estimate,actual,mre for each test record # 4 Prints the costDrivers, followed by the estimate, actual for each test record # Search Methods: # forward # backward # both # Ranking Methods: # native # random # cor_hi # cor_lo # var_hi # var_lo # ent_hi # ent_lo # mmre_hi # mmre_lo # med_mre_hi # med_mre_lo # pred_hi # pred_lo # Evaluation Methods: # mmre # pred30 # corr # median_mre # sd_mre MyRoot="../../../trunk/" # Create tmp directory if necessary if [ ! -d /tmp/$USER ] then mkdir "/tmp/$USER" fi cd .. Train="/tmp/$USER/nasa93_all.csv.numeric" Test="/tmp/$USER/coc81_all.csv.numeric" echo "WARNING - using nasa93 to calibrate to test on coc81 just as an example - not good practice for real use." # Preprocess the data echo "Preprocessing coc81" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method="COC81" Style="precise" $MyRoot"data/coc81.csv" > $Test echo "Preprocessed data stored at "$Test echo "Preprocessing nasa93" gawk -f $MyRoot"baker_lc/convertcsv.awk" Method="COC81" Style="precise" $MyRoot"data/nasa93.csv" > $Train echo "Preprocessed data stored at "$Train # Run cocomin echo "Example of calling cocomin81" cocomin81 $Train "both" "native" "mmre" $Test "4" echo "Example using fastCocomin" fastCocomin 0 $Train $Test 4