From b05e1896f0408aaea3247c0082bf5af35d0e0e56 Mon Sep 17 00:00:00 2001 From: livc Date: Sun, 18 Dec 2016 20:51:40 +0800 Subject: [PATCH] fix bug of 'shuf' and 'gshuf' in demo/recommendation/preprocess.sh --- demo/recommendation/preprocess.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/demo/recommendation/preprocess.sh b/demo/recommendation/preprocess.sh index dc6b2cdfc..eeb81ce3c 100755 --- a/demo/recommendation/preprocess.sh +++ b/demo/recommendation/preprocess.sh @@ -14,6 +14,15 @@ # limitations under the License. set -e +UNAME_STR=`uname` + +if [[ ${UNAME_STR} == 'Linux' ]]; then + SHUF_PROG='shuf' +else + SHUF_PROG='gshuf' +fi + + cd "$(dirname "$0")" delimiter='::' dir=ml-1m @@ -25,7 +34,7 @@ python meta_generator.py $dir meta.bin --config=meta_config.json echo 'split train/test file' python split.py $dir/ratings.dat --delimiter=${delimiter} --test_ratio=0.1 echo 'shuffle train file' -gshuf $dir/ratings.dat.train > ratings.dat.train +${SHUF_PROG} $dir/ratings.dat.train > ratings.dat.train cp $dir/ratings.dat.test . echo "./data/ratings.dat.train" > train.list echo "./data/ratings.dat.test" > test.list -- GitLab