-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathrun_nn.sh
55 lines (50 loc) · 1.41 KB
/
run_nn.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
printf '========== Generate NN Result ==========\n'
CURDIR="`pwd`"/"`dirname $0`"
printf "\nCurrent Path:$CURDIR \n"
train_file=${CURDIR}"/src/input/train.csv"
test1_file=${CURDIR}"/src/input/test1.csv"
test2_file=${CURDIR}"/src/input/test2.csv"
ad_feature=${CURDIR}"/src/input/adFeature.csv"
user_file=${CURDIR}"/src/input/userFeature.data"
user_feature=${CURDIR}"/src/input/userFeature.csv"
dataset_dir=${CURDIR}"/src/dataset/"
train_dir=${CURDIR}"/src/dataset/train/"
valid_dir=${CURDIR}"/src/dataset/dev/"
test2_dir=${CURDIR}"/src/dataset/test/"
train_aid_fea=${dataset_dir}"/train_uid_aid_bin.csv"
fea_dict=${dataset_dir}"/dic.pkl"
sub_file=${CURDIR}"/submission_nffm.csv"
printf '\nStep1: PreProcess UserFeature...\n'
if [ ! -f $user_feature ]; then
cd src
python3 load_vowpal.py
printf 'Save to input/userFeature.csv\n'
cd ..
else
printf 'UserFeature exists, Skip this step!\n'
fi
printf '\nStep2: Make Features...\n'
if [ ! -f $train_aid_fea ]; then
cd src
python3 make_feature.py
cd ..
else
printf 'Feature exists, Skip this step!\n'
fi
printf '\nStep3: Make Dataset...\n'
if [ ! -f $fea_dict ]; then
cd src
python3 make_dataset.py
cd ..
else
printf 'Feature exists, Skip this step!\n'
fi
printf '\nStep4: Train Model and Predic Result...\n'
if [ ! -f $sub_file ]; then
cd src
python3 train.py
cd ..
else
printf 'Train Done, Skip this step!\n'
fi