Skip to content

Commit de353eb

Browse files
authored
Merge pull request #942 from livc/fix_bug_shuf_and_gshuf
fix bug of 'shuf' and 'gshuf' in demo/recommendation/preprocess.sh
2 parents 395aedf + b05e189 commit de353eb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

demo/recommendation/preprocess.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
# limitations under the License.
1515
set -e
1616

17+
UNAME_STR=`uname`
18+
19+
if [[ ${UNAME_STR} == 'Linux' ]]; then
20+
SHUF_PROG='shuf'
21+
else
22+
SHUF_PROG='gshuf'
23+
fi
24+
25+
1726
cd "$(dirname "$0")"
1827
delimiter='::'
1928
dir=ml-1m
@@ -25,7 +34,7 @@ python meta_generator.py $dir meta.bin --config=meta_config.json
2534
echo 'split train/test file'
2635
python split.py $dir/ratings.dat --delimiter=${delimiter} --test_ratio=0.1
2736
echo 'shuffle train file'
28-
gshuf $dir/ratings.dat.train > ratings.dat.train
37+
${SHUF_PROG} $dir/ratings.dat.train > ratings.dat.train
2938
cp $dir/ratings.dat.test .
3039
echo "./data/ratings.dat.train" > train.list
3140
echo "./data/ratings.dat.test" > test.list

0 commit comments

Comments
 (0)