-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
86 lines (79 loc) · 2.66 KB
/
run.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
if [ "$1" != "-v" ] ; then
echo runing quietly, to see output, please use run.sh -v
python -m pip install --upgrade pip > /dev/null
pip install -r frontend/requirements.txt > /dev/null
FILE1=frontend/results/NVDA_SOXX_BTC_GBT.csv
FILE2=frontend/results/NVDA_SOXX_BTC_NN.csv
FILE3=frontend/results/combined_GBT.csv
FILE4=frontend/results/combined_NN.csv
if !(test -f "$FILE1"); then
echo 'building GBT model 1'
cd frontend/model
python GBT.py NVDA_SOXX_BTC.csv 2>&1> /dev/null
cd '../..'
fi
if !(test -f "$FILE2"); then
echo 'building NN model1 1'
cd frontend/model
python neuralNet.py NVDA_SOXX_BTC.csv 2>&1> /dev/null
cd '../..'
fi
if !(test -f "$FILE3"); then
echo 'building GBT model'
cd frontend/model
python GBT.py combined.csv 2>&1> /dev/null
cd '../..'
fi
if !(test -f "$FILE4"); then
echo 'building NN model'
cd frontend/model
python neuralNet.py combined.csv 2>&1> /dev/null
cd '../..'
fi
cd frontend
python init_db.py > /dev/null
echo '######################################'
echo '## Server is running on ##'
echo '## http://127.0.0.1:5000 ##'
echo '## To quit, press Ctrl+C ##'
echo '######################################'
python -m flask run > /dev/null 2>&1
cd '..'
else
python -m pip install --upgrade pip || (echo "python -m pip install --upgrade pip failed" && exit 1)
pip install -r frontend/requirements.txt || (echo "pip install failed" && exit 1)
FILE1=frontend/results/NVDA_SOXX_BTC_GBT.csv
FILE2=frontend/results/NVDA_SOXX_BTC_NN.csv
FILE3=frontend/results/combined_GBT.csv
FILE4=frontend/results/combined_NN.csv
if !(test -f "$FILE1"); then
echo 'building GBT model 1'
cd frontend/model
python GBT.py NVDA_SOXX_BTC.csv
cd '../..'
fi
if !(test -f "$FILE2"); then
echo 'building NN model1 1'
cd frontend/model
python neuralNet.py NVDA_SOXX_BTC.csv
cd '../..'
fi
if !(test -f "$FILE3"); then
echo 'building GBT model 2'
cd frontend/model
python GBT.py combined.csv
cd '../..'
fi
if !(test -f "$FILE4"); then
echo 'building NN model 2'
echo $FILE4
cd frontend/model
python neuralNet.py combined.csv
cd '../..'
fi
cd frontend || (echo "cd frontend failed" && exit 1)
python init_db.py || (echo "python init_db.py failed" && exit 1)
python -m flask run || (echo "python -m flask run failed" && exit 1)
cd '..'
fi