diff options
author | davor <vorgrimmlerdavid@gmx.de> | 2011-11-25 08:56:25 +0100 |
---|---|---|
committer | davor <vorgrimmlerdavid@gmx.de> | 2011-11-25 08:56:25 +0100 |
commit | 20cff56d93b10962ee21577d0a25fc7b5e6907b5 (patch) | |
tree | 9f67e8f4f29d27a00d9c57e34a69a3cd0d0ed981 /5x_cv/wrapper5cv.sh | |
parent | 930a7146d0ea6be142ae3ac66caf7a95df321ad5 (diff) |
Added scripts for automated crossvalidations
Diffstat (limited to '5x_cv/wrapper5cv.sh')
-rwxr-xr-x | 5x_cv/wrapper5cv.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/5x_cv/wrapper5cv.sh b/5x_cv/wrapper5cv.sh new file mode 100755 index 0000000..2155635 --- /dev/null +++ b/5x_cv/wrapper5cv.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Wrapper Skript for CV +# Set Factors, Datasets, Exceptions in the respective config_files +# AM, 2011 + +if [ $# -lt 2 ]; then + echo "Usage: $0 factors datasets" + exit +fi + +# Configure basics +source $HOME/.bash_aliases +otconfig +THIS_DATE=`date +%Y%m%d_%H_` +FACTORS="$1" +DATASETS="$2" + +# Don't start when running +while ps x | grep 5x | grep -v grep >/dev/null 2>&1; do sleep 3; done + +LOGFILE="$THIS_DATE""$USER""_wrapper5cv.log" +rm "$LOGFILE" >/dev/null 2>&1 + +cat $DATASETS | while read dataset_uri; do + if ! [[ "$dataset_uri" =~ "#" ]]; then # allow comments + cat $FACTORS | while read factor; do + if ! [[ "$factor" =~ "#" ]]; then # allow comments + echo "${THIS_DATE}: $factor" >> $LOGFILE>&1 + factor="$factor;dataset_uri=$dataset_uri" + echo "ruby 5x_crossvalidation.rb $factor" >> $LOGFILE 2>&1 + ruby 5x_crossvalidation.rb $factor >> $LOGFILE 2>&1 + fi + done + else + echo >> $LOGFILE 2>&1 + echo $dataset_uri >> $LOGFILE 2>&1 + fi +done |