#!/bin/bash #make -s prep CocomoDir=~/wisp/trunk/cocomo/data Data=nasa93.csv CurrDir=`pwd` #`dirname $0` ThisFile=`basename $0` Tmp=`mktemp -d` echo Hi, welcome to LOCOMO. You are running the file: $ThisFile echo "" echo ...Extracting COCOMO parameters from NASA data. echo "" (printf "=" cat ${CocomoDir}/${Data} | cut -d, -f8- ) > $Tmp/$ThisFile.in cd $Tmp #echo "---| $2 |----------------------" echo ...Converting COCOMO parameters to numerical values. echo "" echo ...Selecting the 20 nearest neighbors to $2. echo "" coc1nums -s $ThisFile.in | near -n 20 $2 > $ThisFile.tmp for((i=1;i<=10;i++)) do echo ...Iteration $i. R=$RANDOM echo ...Randomizing the data and splitting into training and test sets. randomize Seed=$R $ThisFile.tmp echo "" echo ...Performing local calibration on nearest neighbors. echo "" lc Seed=$R Pred=30 Pass=1 train.arff Pass=2 test.arff > ${1}$i.out done echo ...Outputting results to $CurrDir/locomo_results.txt. (echo "#!,a,b,est_effort,mmre,pred(30)" fgrep \! ${1}*.out | sort -t, -n +3) | malign > $CurrDir/locomo_results.txt fgrep -v ^! ${1}*.out > $CurrDir/lc_data.csv