提交 de353eb0 编写于 作者: G gangliao 提交者: GitHub

Merge pull request #942 from livc/fix_bug_shuf_and_gshuf

fix bug of 'shuf' and 'gshuf' in demo/recommendation/preprocess.sh
...@@ -14,6 +14,15 @@ ...@@ -14,6 +14,15 @@
# limitations under the License. # limitations under the License.
set -e set -e
UNAME_STR=`uname`
if [[ ${UNAME_STR} == 'Linux' ]]; then
SHUF_PROG='shuf'
else
SHUF_PROG='gshuf'
fi
cd "$(dirname "$0")" cd "$(dirname "$0")"
delimiter='::' delimiter='::'
dir=ml-1m dir=ml-1m
...@@ -25,7 +34,7 @@ python meta_generator.py $dir meta.bin --config=meta_config.json ...@@ -25,7 +34,7 @@ python meta_generator.py $dir meta.bin --config=meta_config.json
echo 'split train/test file' echo 'split train/test file'
python split.py $dir/ratings.dat --delimiter=${delimiter} --test_ratio=0.1 python split.py $dir/ratings.dat --delimiter=${delimiter} --test_ratio=0.1
echo 'shuffle train file' 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 . cp $dir/ratings.dat.test .
echo "./data/ratings.dat.train" > train.list echo "./data/ratings.dat.train" > train.list
echo "./data/ratings.dat.test" > test.list echo "./data/ratings.dat.test" > test.list
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册