From e3f7237ffcb19f19db3b68777b5a94b89e07f66a Mon Sep 17 00:00:00 2001
From: ziejd2
Date: Thu, 13 Sep 2018 23:59:20 -0500
Subject: New parameter learning options
The main change here is in the parameter learning methods. The parameters that are learned at first (i.e., if there is no evidence) are the distributions that are found directly in the data. I had to create or significantly modify several BNT files for this.
If there is evidence, the parameters are learned using a Dirichlet prior. This only required a couple of small changes to the BNW parameter learning files.
---
sourcecodes/BNW_workflow_net1.htm | 6 +-
sourcecodes/add_evd.php | 15 +-
sourcecodes/add_evd_example.php | 12 +-
sourcecodes/add_inv.php | 5 +-
sourcecodes/add_inv_example.php | 4 +-
sourcecodes/bn_file_load_gom.php | 5 +-
.../BNT/CPDs/@discrete_CPD/convert_to_pot_orig.m | 62 ++
.../BNT/CPDs/@discrete_CPD/convert_to_pot_orig.m~ | 62 ++
.../BNT/CPDs/@discrete_CPD/convert_to_table_orig.m | 15 +
.../CPDs/@discrete_CPD/convert_to_table_orig.m~ | 15 +
.../BNT/CPDs/@tabular_CPD/CPD_to_CPT_orig.m | 5 +
.../BNT/CPDs/@tabular_CPD/CPD_to_CPT_orig.m~ | 5 +
.../bnt-master/BNT/CPDs/@tabular_CPD/get_field.m | 1 +
.../BNT/CPDs/@tabular_CPD/learn_params_orig.m | 20 +
.../BNT/CPDs/@tabular_CPD/learn_params_orig.m~ | 20 +
.../bnt-master/BNT/CPDs/@tabular_CPD/tabular_CPD.m | 3 +
.../@jtree_inf_engine/marginal_nodes_no_ev.m | 18 +
.../@jtree_inf_engine/marginal_nodes_no_ev.m~ | 18 +
sourcecodes/bnt-master/BNT/learning/learn_params.m | 3 +
sourcecodes/clear.php | 11 +-
sourcecodes/clear_example.php | 9 +-
sourcecodes/create_tiers_gom.php | 6 +-
sourcecodes/cross_valid.php | 125 +++
sourcecodes/cross_valid_example.php | 125 +++
sourcecodes/cv_predictions.php | 94 ++
sourcecodes/cv_predictions_example.php | 94 ++
.../data/example1/Bqxcontinuous_input_orig.txt | 201 ++++
.../data/example2/hQGcontinuous_input_orig.txt | 201 ++++
.../data/example_chl/bWRcontinuous_input_orig.txt | 42 +
.../cuLcontinuous_input_orig.txt | 74 ++
.../data/example_sci/Llucontinuous_input_orig.txt | 501 ++++++++++
.../TEbcontinuous_input_orig.txt | 501 ++++++++++
.../examplecar15node/eIAcontinuous_input_orig.txt | 1001 ++++++++++++++++++++
sourcecodes/enter_netID.php | 77 ++
sourcecodes/example.php | 7 +-
sourcecodes/execute_bn_gom.php | 6 +-
sourcecodes/executionprogress.php | 5 +-
sourcecodes/faq.php | 9 +-
sourcecodes/filecopy.sh | 14 +-
sourcecodes/graphviz_structure.php | 3 +-
sourcecodes/header_batchsearch.inc | 11 +
sourcecodes/header_batchsearch.inc~ | 253 +++++
sourcecodes/help.php | 25 +-
sourcecodes/home.php | 1 +
sourcecodes/input_error.php | 27 +
sourcecodes/input_error_no_menu.php | 3 +
sourcecodes/input_error_no_menu.php~ | 3 +
sourcecodes/input_validate.php | 30 +
sourcecodes/keyval_error.php | 27 +
sourcecodes/kfold_cv.php | 150 +++
sourcecodes/kfold_cv_example.php | 150 +++
sourcecodes/layout.php | 13 +-
sourcecodes/layout_example.php | 12 +-
sourcecodes/matrix.php | 3 +-
sourcecodes/net_structure.php | 3 +-
sourcecodes/network_layout_evd.php | 30 +-
sourcecodes/network_layout_evd_2.php | 31 +-
sourcecodes/network_layout_evd_2_example.php | 26 +-
sourcecodes/network_layout_evd_example.php | 25 +-
sourcecodes/network_layout_inv.php | 24 +-
sourcecodes/network_layout_inv_2.php | 26 +-
sourcecodes/network_layout_inv_2_example.php | 28 +-
sourcecodes/network_layout_inv_example.php | 24 +-
sourcecodes/parameter_display.php | 5 +-
sourcecodes/parameter_learning/drawFigure.m | 3 +-
sourcecodes/parameter_learning/kfoldCrossValid.m | 322 +++++++
sourcecodes/parameter_learning/looCrossValid.m | 250 +++++
sourcecodes/parameter_learning/parameterLearning.m | 5 +-
sourcecodes/parameter_learning/prepareInput.m | 2 +-
.../parameter_learning/testSetPredictions.m | 361 +++++++
sourcecodes/parameter_learning/writeParameters.m | 3 +-
sourcecodes/run_kfold | 14 +
sourcecodes/run_loo | 14 +
sourcecodes/run_test_set | 11 +
sourcecodes/test_set_predictions.php | 158 +++
sourcecodes/test_set_predictions_example.php | 158 +++
sourcecodes/tier_description_processing_gom.php | 4 +-
sourcecodes/upload_structure_file.php | 3 +
78 files changed, 5510 insertions(+), 128 deletions(-)
create mode 100644 sourcecodes/bnt-master/BNT/CPDs/@discrete_CPD/convert_to_pot_orig.m
create mode 100644 sourcecodes/bnt-master/BNT/CPDs/@discrete_CPD/convert_to_pot_orig.m~
create mode 100644 sourcecodes/bnt-master/BNT/CPDs/@discrete_CPD/convert_to_table_orig.m
create mode 100644 sourcecodes/bnt-master/BNT/CPDs/@discrete_CPD/convert_to_table_orig.m~
create mode 100644 sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/CPD_to_CPT_orig.m
create mode 100644 sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/CPD_to_CPT_orig.m~
create mode 100644 sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/learn_params_orig.m
create mode 100644 sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/learn_params_orig.m~
create mode 100644 sourcecodes/bnt-master/BNT/inference/static/@jtree_inf_engine/marginal_nodes_no_ev.m
create mode 100644 sourcecodes/bnt-master/BNT/inference/static/@jtree_inf_engine/marginal_nodes_no_ev.m~
create mode 100644 sourcecodes/cross_valid.php
create mode 100644 sourcecodes/cross_valid_example.php
create mode 100644 sourcecodes/cv_predictions.php
create mode 100644 sourcecodes/cv_predictions_example.php
create mode 100644 sourcecodes/data/example1/Bqxcontinuous_input_orig.txt
create mode 100644 sourcecodes/data/example2/hQGcontinuous_input_orig.txt
create mode 100644 sourcecodes/data/example_chl/bWRcontinuous_input_orig.txt
create mode 100644 sourcecodes/data/example_chr2_spleen/cuLcontinuous_input_orig.txt
create mode 100644 sourcecodes/data/example_sci/Llucontinuous_input_orig.txt
create mode 100644 sourcecodes/data/example_time_series/TEbcontinuous_input_orig.txt
create mode 100644 sourcecodes/data/examplecar15node/eIAcontinuous_input_orig.txt
create mode 100644 sourcecodes/enter_netID.php
create mode 100644 sourcecodes/header_batchsearch.inc~
create mode 100644 sourcecodes/input_error.php
create mode 100644 sourcecodes/input_error_no_menu.php
create mode 100644 sourcecodes/input_error_no_menu.php~
create mode 100644 sourcecodes/input_validate.php
create mode 100644 sourcecodes/keyval_error.php
create mode 100644 sourcecodes/kfold_cv.php
create mode 100644 sourcecodes/kfold_cv_example.php
create mode 100644 sourcecodes/parameter_learning/kfoldCrossValid.m
create mode 100644 sourcecodes/parameter_learning/looCrossValid.m
create mode 100644 sourcecodes/parameter_learning/testSetPredictions.m
create mode 100644 sourcecodes/run_kfold
create mode 100644 sourcecodes/run_loo
create mode 100644 sourcecodes/run_test_set
create mode 100644 sourcecodes/test_set_predictions.php
create mode 100644 sourcecodes/test_set_predictions_example.php
(limited to 'sourcecodes')
diff --git a/sourcecodes/BNW_workflow_net1.htm b/sourcecodes/BNW_workflow_net1.htm
index d69ddf84..318dd5c2 100644
--- a/sourcecodes/BNW_workflow_net1.htm
+++ b/sourcecodes/BNW_workflow_net1.htm
@@ -294,7 +294,7 @@ ul
line-height:115%;font-family:"Arial","sans-serif"'>
**Recent updates to BNW may result in slight differences between what is described/shown below and what would currently be experienced in BNW.**
This tutorial provides
-an overview of using BNW to build a Bayesian network model from a dataset and use the network to make predictions. The dataset used in this tutorial is a synthetic example of a genetic dataset that has a total of 8 variables. Two of the variables are genotypes labeled Geno1 and Geno2, and the remaining 6 variables are gene expression levels or other quantitative traits that are labeled Trait1 to Trait6. The dataset is available here.
The data file is formatted according to the guidelines on the BNW help page. The first row of the file contains the names of the variables and the remaining rows contain the data for each sample of the dataset. The genotypes (Geno1 and Geno2), which are the only discrete variables in the network, are the leftmost variables in the input file and are integer values (1 and 2) for all of the samples. The quantitative traits are continuous variables, and, therefore, all contain a "." in at least one of the samples.
1. Structure learning using default options
@@ -358,7 +358,7 @@ normal'>
To make predictions with the network, we will use the structure learned after model averaging of the top 100 highest scoring networks. First, we will use the model to compare the expected values for nodes in the network based on observed genotypes. For these predictions, we will keep the prediction in evidence mode. The difference between evidence and intervention modes is discussed in the BNW FAQ page. To use the model to make predictions based on Geno1, click on one of the blue bars in the Geno1 node and enter 1 or 2 to indicate which genotype value should be used to predict the values of the other network nodes. In the figure below, Geno1 is outlined in red and state 2 has a 100% probability, indicating that the value of this node has been entered as evidence. The red lines in the figure show the predicted distributions of the nodes after this evidence is known and can be compared with the blue lines which show the distributions for variables using the original data.
diff --git a/sourcecodes/add_evd.php b/sourcecodes/add_evd.php
index 92aca69f..346aba04 100644
--- a/sourcecodes/add_evd.php
+++ b/sourcecodes/add_evd.php
@@ -1,6 +1,6 @@
diff --git a/sourcecodes/add_evd_example.php b/sourcecodes/add_evd_example.php
index a38d4474..29465fae 100644
--- a/sourcecodes/add_evd_example.php
+++ b/sourcecodes/add_evd_example.php
@@ -1,6 +1,6 @@
diff --git a/sourcecodes/add_inv.php b/sourcecodes/add_inv.php
index c2953f85..25b7b7ba 100644
--- a/sourcecodes/add_inv.php
+++ b/sourcecodes/add_inv.php
@@ -1,6 +1,7 @@
diff --git a/sourcecodes/clear_example.php b/sourcecodes/clear_example.php
index 4b0a8315..c01a6f7e 100644
--- a/sourcecodes/clear_example.php
+++ b/sourcecodes/clear_example.php
@@ -1,6 +1,10 @@
diff --git a/sourcecodes/create_tiers_gom.php b/sourcecodes/create_tiers_gom.php
index be8e2fc2..b830f529 100644
--- a/sourcecodes/create_tiers_gom.php
+++ b/sourcecodes/create_tiers_gom.php
@@ -4,7 +4,7 @@
include("header_new.inc");
include("runtime_check.php");
-
+include("input_validate.php");
$keyval=$_GET["My_key"];
$dir="./data/";
@@ -41,6 +41,7 @@ $structure_thr=trim($type_n[3]);
if($keyval=="")
$keyval=$type_n[4];
+
if($parent_number=="")
{
$parent_number=4;
@@ -81,7 +82,8 @@ $thrfile=$dir.$keyval."thr.txt";
$kf=fopen($thrfile,"w");
fwrite($kf,"$structure_thr\n");
-//////////////////Check execution time///////////////////////////////////////////////
+//////////////////Check execution time//////////////////////////////////////////////
+$keyval=valid_keyval($keyval);
$runtime=exe_time($keyval,$parent_number,$k_number);
//print("Runtime is $runtime");
diff --git a/sourcecodes/cross_valid.php b/sourcecodes/cross_valid.php
new file mode 100644
index 00000000..8c402283
--- /dev/null
+++ b/sourcecodes/cross_valid.php
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Enter the name of another variable below to validate predictions of that variable.
+
+
+
+
+ To perform cross-validation, enter the name of the variable that you want to test the predictions of below.
+
+
+
+
+ Leave-one-out cross-validation results are being calculated
+
+ Refresh to update status
+
+
+
+ >View cross-validation results
+
+Perform leave-one-out cross-validation of another network variable
+
+
+
+Perform leave-one-out cross-validation of network
+
+
+
+ /dev/null 2 > /dev/null &");
+ $pred_link='cv_predictions.php?My_key='.$keyval;
+ sleep(1);
+ echo "
";
+ echo "Calculation submitted";
+ echo "
";
+ echo "Click to return to cross-validation and predictions menu";
+}
+?>
+
+