📄 bench
字号:
#!/bin/bashCLASSPATH=".."; export CLASSPATHulimit -t 1200 -v 1048576mode=$1if [[ $mode != "ext" && $mode != "prune" \ && $mode != "perfect" && $mode != "ring" ]]; then echo "usage: $0 (ext|prune|perfect|ring) [dataset [supplist [options]]]" exitfitest=${2:-"ic93"}list=$3if [[ $list == "" ]]; then if [[ $test == "ic93" ]]; then list="3.0 3.5 4.0 4.5 5.0 5.5 6.0"; elif [[ $test == "steroids" ]]; then list="-1 -2 -3 -4 -5 -6 -7 -8"; else list="10 20 30 40 50 60 70 80 90 100"; fifishift; shift; shiftdata=data/$test.slnbase="java -Xmx800M moss.Miner -isln -osln ~ $data"rm -f moss.sub $test.resfor supp in $list; do rm -f $test.tmp echo "support: $supp" | tee -a $test.tmp # --- comparison of extension types --- if [[ $mode == "ext" ]]; then cmd="$base -s$supp -e -p $*" echo "extension: rightmost" | tee -a $test.tmp $cmd -q -g 2>&1 | tee -a $test.tmp echo "extension: rgtm+can" | tee -a $test.tmp $cmd +q -g 2>&1 | tee -a $test.tmp echo "extension: maxsrc" | tee -a $test.tmp $cmd -q 2>&1 | tee -a $test.tmp echo "extension: msrc+can" | tee -a $test.tmp $cmd +q 2>&1 | tee -a $test.tmp fi # --- comparison of pruning techniques 1 --- if [[ $mode == "prune" ]]; then cmd="$base -s$supp $*" echo "pruning: none" | tee -a $test.tmp $cmd -e -p -q 2>&1 | tee -a $test.tmp echo "pruning: perfect" | tee -a $test.tmp $cmd -e +p -q 2>&1 | tee -a $test.tmp echo "pruning: equiv" | tee -a $test.tmp $cmd +e -p -q 2>&1 | tee -a $test.tmp echo "pruning: canonic" | tee -a $test.tmp $cmd -e -p +q 2>&1 | tee -a $test.tmp echo "pruning: equ+can" | tee -a $test.tmp $cmd +e -p +q 2>&1 | tee -a $test.tmp echo "pruning: per+can" | tee -a $test.tmp $cmd -e +p +q 2>&1 | tee -a $test.tmp echo "pruning: all" | tee -a $test.tmp $cmd +e +p +q 2>&1 | tee -a $test.tmp fi # --- comparison of pruning techniques 2 --- if [[ $mode == "perfect" ]]; then cmd="$base -s$supp -e +q $*" echo "pruning: none" | tee -a $test.tmp $cmd -p -P 2>&1 | tee -a $test.tmp echo "pruning: partial" | tee -a $test.tmp $cmd -p +P 2>&1 | tee -a $test.tmp echo "pruning: full" | tee -a $test.tmp $cmd +p -P 2>&1 | tee -a $test.tmp fi # --- comparison of ring mining --- if [[ $mode == "ring" ]]; then cmd="$base -s$supp -r5:6 -e -p $*" echo "pruning: repos" | tee -a $test.tmp $cmd -R -q 2>&1 | tee -a $test.tmp echo "pruning: close" | tee -a $test.tmp $cmd -O +q 2>&1 | tee -a $test.tmp echo "pruning: merge" | tee -a $test.tmp $cmd -E +q 2>&1 | tee -a $test.tmp echo "pruning: reorder" | tee -a $test.tmp $cmd -R +q 2>&1 | tee -a $test.tmp fi gawk ' ($1 == "support:") { support = ($2 >= 0) ? $2 : -$2; } ($1 == "pruning:") { prlist[n++] = pruning = $2; } ($1 == "extension:") { prlist[n++] = pruning = $2; } ((NF > 2) && ($(NF-2) == "substructure(s)]")) { subs[pruning] = substr($(NF-3), index($1, "[") +1); time[pruning] = substr($NF, 2, length($NF)-4); } ($1 == "number") && ($5 == "nodes") { nodes [pruning] = $NF; } ($1 == "number") && ($4 == "fragments") { frags [pruning] = $NF; } ($1 == "number") && ($4 == "embeddings:") { embeds[pruning] = $NF; } END { printf("%6.2f ", support); printf("time subs nodes frags embeds\n"); for (i = 0; i < n; i++) { pruning = prlist[i]; printf("%-10s ", pruning); printf("%7.2f ", time[pruning]); printf("%8d ", subs[pruning]); printf("%8d ", nodes[pruning]); printf("%8d ", frags[pruning]); printf("%9d\n", embeds[pruning]); } }' $test.tmp >> $test.resdoneecho ""cat $test.resrm -f moss.sub $test.tmp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -