-
Notifications
You must be signed in to change notification settings - Fork 1
/
analysis.R
30 lines (21 loc) · 979 Bytes
/
analysis.R
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
################
### PACKAGES ###
################
# Import functions from tools.R file
source("tools.R")
####################
### LOADING DATA ###
####################
# Convert columns to double such that the algorithms work
ff = read.csv("data/ff_preprocessed.csv", header = TRUE, colClasses = rep("double", 11))
head(ff)
################
### ANALYSIS ###
################
result_experiment = run_experiment(ff, is_plot=TRUE, algorithms=c("tabu","hiton"),
exp_values=list(c("loglik-g","bic-g","bge"),c(0.01,0.05,0.1,0.25)))
best_bn_structures = result_experiment$bn_structures[c(2,7)]
best_adjacency_mats = result_experiment$adjacency_mats[c(2,7)]
# result can be indexed like so (the first three indices/entries are from tabu and the other four from si.hiton.pc)
# result$bn_structures; result$adjacency_mats; result$betweenness; result$degree; result$hamming
result_comparison = compare_to_original(best_bn_structures, best_adjacency_mats)