diff options
author | rautenberg <rautenberg@in-silico.ch> | 2012-03-13 15:45:11 +0100 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2012-03-13 15:45:11 +0100 |
commit | ed3793243057f14fbe94a2eaed11cc07bcce0949 (patch) | |
tree | c31d0bdbd048ab7525c8a6911d470388dcffb761 /5x_cv/wrapper5cv.sh | |
parent | 2ace4b04bb655328fc8cd512b9a45edd9999fbf8 (diff) | |
parent | c5eb2319eaedfb289d02efea43019008500e7511 (diff) |
Merge branch 'release/v3.1.0'v3.1.0
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 |