about summary refs log tree commit diff
path: root/var_lib_genenet_bnw/run.sh
blob: d7389dadccecc0e191f51e315dce530eff76e0d5 (plain)
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
#!/bin/bash
d=`dirname $0`
#Name of the data directory
data=$1

DIR="$d/$data/tmp"
DIR_1="$d/$data/tmp/"

mkdir -p $DIR
#Arguments. User can modify these arguments.

#Input data file name.
input="$d/$data/input.txt"

#Input banlist file
ban="$d/$data/banlist.txt"

#Input whitelist file
white="$d/$data/whitelist.txt"

#Max parents. We set the number of maximum parents to 4 
maxparent=4

#k is the numbeer of structure considered in each step of k-best structure learning algorithm. We set the value of k=100
k=100

#Model averaging threshold. We set the model averaging threshold to 0.5
THR=0.5


echo "Dataset with number of variables:"
head -1 $input|wc -w
echo "Dataset with number of samples:"
wc -l $input|cut -d' ' -f1
echo "Parameters are: max parent = $maxparent, k= $k and model averaging threshold = $THR"

start_time1=`date +%s`
#execute local score
./network_score $input $ban $white $maxparent $DIR
end_time=`date +%s`
echo "Local score execution time was `expr $end_time - $start_time1` s."

start_time=`date +%s`
#execute k-best structure learning
sh $d/k-best/src/data2netk_poster.sh $input $DIR $k $maxparent

end_time=`date +%s`
echo "k-best parent total execution time was `expr $end_time - $start_time` s."

start_time=`date +%s`
#execute print structure
./structure $input $DIR/postProbEachEdge.txt $d/$data/model_averaging_probabilities.txt $d/$data/model_structure.txt $THR

end_time1=`date +%s`
echo "Preparing structure output file from model averaging matrix. Execution time was `expr $end_time1 - $start_time` s."
echo "Total execution time was `expr $end_time1 - $start_time1` s."
rm -r $DIR_1*
rmdir $DIR