# /* vim: set filetype=sh : */ Safe=$HOME/tmp/locomo/6 mkdir -p $Safe Dir=../../cocomo/data Data=nasa93.csv Tmp=`mktemp -d` #trap "rm -rf $Tmp" 0 1 2 3 15 (printf "=" cat ${Dir}/${Data} | cut -d, -f8- ) > $Tmp/$0.in head -1 ${Dir}/${Data} > $Tmp/head cd $Tmp main() { echo "---| $1 |----------------------" printf "$2 \n\n" for n in 15 30 45 60 100 do echo "::: $n" coc1nums -s $0.in \ | near -n $n $2 > $0.tmp for((i=1;i<=20;i++)) do R=$RANDOM randomize TestSets=5 Seed=$R $0.tmp lc ShowRE=re_$1_$n Seed=$R Pred=30 Pass=1 train.arff Pass=2 test.arff > ${1}$i.out done cat re_$1_$n | sort -n > sorted mv sorted re_$1_$n gawk '{sum += $1 }END{ print sum}' re_$1_$n > area_$1_$n ls -lsa re_* fgrep \! ${1}*.out| sort -t, -n +3| cut -d, -f 4| cat -n|sed 's/,/ /' > 4_$n fgrep \! ${1}*.out| sort -t, -n +4| cut -d, -f 5| cat -n|sed 's/,/ /' > 5_$n continue (echo "#!,a,b,mmre,pred(30)" fgrep \! ${1}*.out | sort -t, -n +4 ) | malign echo "" (cut -d, -f 8-22 head gawk -F, ' function mean(sumX,n) {return sumX/n} function sd(sumSq,sumX,n) {return sqrt((sumSq-((sumX*sumX)/n))/(n-1))} /=/ { q=","; key=$3 q $4 q $5 q $6 q $7 q $8 q $9 q \ $10 q $11 q $12 q $13 q $14 q $15 q $16 q $17 val=$NF; s[ key] += val; s2[key] += val * val; n[key]++ } END { OFS=","; OFMT="%.0f"; for(i in s) { mn = mean(s[i],n[i]); stdev = sd(s2[i],s[i],n[i]) print i , "|", mn, stdev, 100*stdev/mn } } ' ${1}*.out ) | malign -g 1 done gnuplot<