From 74b673ba4a706085201a5610b938ff98f08f641d Mon Sep 17 00:00:00 2001 From: ziejd2 Date: Wed, 25 Apr 2018 16:43:19 -0500 Subject: Bug fixes, code comments, and minor changes --- sourcecodes/parameter_learning/Predictmultiple.m | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'sourcecodes/parameter_learning/Predictmultiple.m') diff --git a/sourcecodes/parameter_learning/Predictmultiple.m b/sourcecodes/parameter_learning/Predictmultiple.m index f03568ef..a7236e35 100644 --- a/sourcecodes/parameter_learning/Predictmultiple.m +++ b/sourcecodes/parameter_learning/Predictmultiple.m @@ -1,4 +1,18 @@ function Predictmultiple(pre) +% Predictmultiple is used when predicting the impact of entering +% evidence on the network. The 'multiple' part refers to +% it working when evidence for multiple nodes is entered. +% +% The input is 'pre'-- the prefix for the network and data +% in BNW. It reads information from several files from BNW. +% +% The output is ???net_figure_new.txt. It also calls +% writeParameters_ev to write the parameter file. +% +% It is called by the run_octave_evd file in the 'sourcecodes' directory. + + + dfile=strcat(pre,'structure_input.txt'); sfile=dfile; dfile=strcat(pre,'continuous_input.txt'); @@ -28,14 +42,14 @@ mapfile = strcat(pre,'map.txt'); fmap = fopen(mapfile,'r'); for i=1:nnodes buffer = fgetl(mapfile); - temp = cell(1,4); - for j=1:4 + temp = cell(1,3); + for j=1:3 [next,buffer] = strtok(buffer); temp{j} = next; end labels_orig{i} = temp{1}; - means_orig{i} = str2num(temp{4}); - stdevs_orig{i} = str2num(temp{3}); + means_orig{i} = str2num(temp{3}); + stdevs_orig{i} = str2num(temp{2}); end fclose(fmap); -- cgit 1.4.1